Registry Key to Hide Last Username on Windows Logon

By default, Windows displays the username of the last person who signed in on the logon screen. This article explains which Windows Registry (Regedit) value controls this behavior and provides the exact steps to configure it so that users must manually enter both their username and password, enhancing system security and privacy.

The Registry Value

The display of the last logged-on user is controlled by the dontdisplaylastusername value located in the Windows Registry.

Value Data Options


How to Change the Value in Regedit

  1. Press Win + R, type regedit, and press Enter to open the Registry Editor.

  2. Navigate to the following key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  3. In the right pane, locate the DWORD value named dontdisplaylastusername. If it does not exist, right-click an empty area, select New > DWORD (32-bit) Value, and name it dontdisplaylastusername.

  4. Double-click dontdisplaylastusername to edit it.

  5. Set the Value data field to:

    • 1 to hide the last logged-on username.
    • 0 to show the last logged-on username.
  6. Click OK, close the Registry Editor, and restart your computer or sign out for the changes to take effect.