Automatic Logon in Windows

Modified on Mon, Oct 31, 2022 at 4:02 PM

To use Registry Editor to turn on automatic logon, follow these steps:

  1. Click Start, and then click Run.

  2. In the Open box, type Regedit.exe, and then press Enter.

  3. Locate the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon subkey in the registry.

  4. Double-click the DefaultUserName entry, type your user name, and then click OK.

  5. Double-click the DefaultPassword entry, type your password, and then click OK.

    If the DefaultPassword value does not exist, it must be added. To add the value, follow these steps:

    1. On the Edit menu, click New, and then point to String Value.

    2. Type DefaultPassword, and then press Enter.

    3. Double-click DefaultPassword.

    4. In the Edit String dialog, type your password and then click OK.

       Note

      If no DefaultPassword string is specified, Windows automatically changes the value of the AutoAdminLogon key from 1 (true) to 0 (false), disabling the AutoAdminLogon feature.

  6. On the Edit menu, click New, and then point to String Value.

  7. Type AutoAdminLogon, and then press Enter.

  8. Double-click AutoAdminLogon.

  9. In the Edit String dialog box, type 1 and then click OK.

  10. If you have joined the computer to a domain, you should add the DefaultDomainName value, and the data for the value should be set as the fully qualified domain name (FQDN) of the domain, for example contoso.com..

  11. Exit Registry Editor.

  12. Click Start, click Shutdown, and then type a reason in the Comment text box.

  13. Click OK to turn off your computer.

  14. Restart your computer. You can now log on automatically.

 Note

  • To bypass the AutoAdminLogon process and to log on as a different user, press and hold the Shift key after you log off or after Windows restarts.
  • This registry change does not work if the Logon Banner value is defined on the server either by a Group Policy object (GPO) or by a local policy. When the policy is changed so that it does not affect the computer, the autologon feature works as expected.
  • When Exchange Active Sync (EAS) password restrictions are active, the autologon feature does not work. This behavior is by design. This behavior is caused by a change in Windows 8.1 and does not affect Windows 8 or earlier versions. To work around this behavior in Windows 8.1 and later versions, remove the EAS policies in Control Panel.
  • An interactive console logon that has a different user on the server changes the DefaultUserName registry entry as the last logged-on user indicator. AutoAdminLogon relies on the DefaultUserName entry to match the user and password. Therefore, AutoAdminLogon may fail. You can configure a shutdown script to set the correct DefaultUserName.
  • You can use the Sysinternals tool AutoLogon to enable this functionality easier. This tool also helps you to use an encrypted version of password.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article