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.
- Registry Path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System - Value Name:
dontdisplaylastusername - Value Type:
REG_DWORD(32-bit Value)
Value Data Options
0(Default): Windows displays the name and profile picture of the last user who successfully signed in.1: Windows hides the last logged-on username. The logon screen presents blank fields where the user must type both their username and password.
How to Change the Value in Regedit
Press Win + R, type
regedit, and press Enter to open the Registry Editor.Navigate to the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\SystemIn 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 itdontdisplaylastusername.Double-click
dontdisplaylastusernameto edit it.Set the Value data field to:
1to hide the last logged-on username.0to show the last logged-on username.
Click OK, close the Registry Editor, and restart your computer or sign out for the changes to take effect.