How to automatically login into Windows Operating Systems?

Do you know that is possible to configure your computer to start immediately, without the need to input a username and password?

This article describes how to configure Windows to automate the login process by storing your password and other pertinent information in the registry database.

But be careful and be noticed, by using this feature, other users can start your computer and use your account freely.

The autologon feature is provided as a convenience. However, this feature may be a security risk.

Windows Login Screen
Windows Login Screen

If you set a computer for autologon, anyone who can physically obtain access to the computer can gain access to all the computer’s contents, including any networks it is connected to.

Additionally, when autologon is turned on, the password is stored in the registry in plain text. The specific registry key that stores this value can be remotely read by the Authenticated Users group. This setting is recommended only for cases in which the computer is physically secured and steps have been taken to make sure that untrusted users cannot remotely access the registry.

Use Registry Editor to turn on automatic logon

Before editing your registry you should know that serious problems might occur if you modify it incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs.

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 Regedt32.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.
Run Regedt32.exe (Windows Registry Editor)
Run Regedt32.exe (Windows Registry Editor)

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

  • On the Edit menu, click New, and then point to String Value.
  • Type DefaultPassword, and then press Enter.
  • Double-click DefaultPassword.
  • In the Edit String dialog, type your password and then click OK.

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.

  1. On the Edit menu, click New, and then point to String Value.
  2. Type AutoAdminLogon, and then press Enter.
  3. Double-click AutoAdminLogon.
  4. In the Edit String dialog box, type 1 and then click OK.
  5. If you have joined the computer to a domain, you should add the DefaultDomain value, and the data for the value should be set as the fully qualified domain name (FQDN) of the domain.
  6. Exit Registry Editor.
  7. Click Start, click Shutdown, and then type a reason in the Comment text box.
  8. Click OK to turn off your computer.
  9. Restart your computer. You can now log on automatically.

To Logon as a different user (after enabling automatic logon)

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 the password.