Enable automatic logon
Automatic logon for a
user is enabled by setting the value of
AutoAdminLogon to 1, the value of
DefaultUserName to the name of an existing user and
DefaultPassword to his/her password.
When in a domain, DefaultDomain
is additionally needed.
@set /p password="Enter password for %USERNAME%: "
@reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName /t REG_SZ /d %USERNAME% /f
@reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword /t REG_SZ /d %password% /f
@reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoAdminLogon /t REG_SZ /d 1 /f
In order to bypass this mechanism, the
shift key must be pressed after/while starting
Windows.