The original question was different, but I have actually provided an answer to this question before. See my post in the question "Always display the last / default user Windows 7 welcome screen" - it explains how to set up UAC and hidden accounts together so you can authenticate to the account via UAC but not log into it from the welcome screen.
Essentially, what you need to do is configure UAC to prompt for the user to enter both their username and password manually, allowing you to enter a username which is hidden from the login screen but still enabled. Instructions on how to do this are on the linked post.
In the meantime, it should still be possible for you to recover the account without doing a full reinstall. Open a command prompt (cmd.exe
), and type runas /user:USERNAME regedit.exe
, where USERNAME is the name of the administrative account. It will prompt you for that user's password; enter it and hit enter. This will open the registry editor running as that user, from which you can go in and revert the changes you made, adding back the account to the login screen.
Re-read your question and noticed that you said run-as won't work. What happens when you try booting into safe mode? I seem to recall that with Windows 7 Home Premium, the built-in administrator account is disabled by default, but is enabled in safe mode, allowing you to log into it and make changes. Unless you have hidden the built-in account in addition to whatever account you set up, this may work.
Finally, if all else fails, you could try running a system restore from the recovery console. Boot onto your Windows 7 installation disk, and choose to "repair a windows installation" instead of install. You can select your installation, then will eventually get to a screen where you can choose to do a restore. This should change the registry back to how it was before you made the change, if it has an old enough restore point. Your files will not be modified by a system restore, although some system settings might be.
Warning! Following is going to modify/replace some system files and modifying registry keys at HKLM. You will not able to use some builtin accessibility options.I think that some virus scanners do not like this (modifying system files this way) and may require excluding modified files from scan. Thats not all... we are replacing files that will run under mighty SYSTEM account, so your fresh scripts will have same permissions.
[optional] If you know how to behave as TrustedInstaller
while setting this up there is no need to change permissions.
[info] CWD
= something
Tells you Current Working Directory.
Okay, last warning is that there is possibility that small typo will lock you out of your system and you may need to take control back while being offline [in terms of running os].
First, take advantage of running programs at logon screen
One quick way to achieve this is to replace %windir%\System32\Utilman.exe
with your own program, in this case it is replaced with application that writes list of visible / hidden users to registry.
CWD
= anything you want
You need program that toggles visible users, one easy way to write simple programs is to use notepad
and any batch compiler. (linked compiler has built in editor)
If using this method you will need some code to place inside too:
@echo off
IF EXIST "%SYSTEMROOT%\System32\SwitchVisibleUsers\hidden.state" (
del %SYSTEMROOT%\System32\SwitchVisibleUsers\hidden.state
regedit /s "%SYSTEMROOT%\System32\SwitchVisibleUsers\displayusers.reg"
) ELSE (
echo "1" > "%SYSTEMROOT%\System32\SwitchVisibleUsers\hidden.state"
regedit /s "%SYSTEMROOT%\System32\SwitchVisibleUsers\hideusers.reg"
)
wmic process where (name="LogonUI.exe") delete
Here is explanation what above script does:
Let's break above code down, do not copypaste this!
First line checks if status file exists, filename quoted:
1| IF EXIST "%SYSTEMROOT%\System32\SwitchVisibleUsers\hidden.state" (
If file exists then delete file that we cheked:
2| del %SYSTEMROOT%\System32\SwitchVisibleUsers\hidden.state
And write displayusers.reg contents to registry:
3| regedit /s "%SYSTEMROOT%\System32\SwitchVisibleUsers\displayusers.reg"
4| ) ELSE (
If status file does not exist then create it:
5| echo "1" > "%SYSTEMROOT%\System32\SwitchVisibleUsers\hidden.state"
And write contents of hideusers.reg to registry:
6| regedit /s "%SYSTEMROOT%\System32\SwitchVisibleUsers\hideusers.reg"
7| )
Registry values written, kill LogonUI.exe to reload (LogonUI restarts)
8| wmic process where (name="LogonUI.exe") delete
Replace system files
After that save your file as Utilman.cmd
and compile it so it will be Utilman.exe
, we are good if you have compiled your batch and your .exe
file is working. Copy your fresh utilman.exe
to clipboard.
CWD
= %SYSTEMROOT%\System32\
Now, replace microsoft's utilman.exe
with your own fresh utilman.exe
. You may need to take ownership of files and set permissions to allow modifying files at system32.
Define special users (registry keys/values to change):
Create new directory SwitchVisibleUsers
.
CWD
= %SYSTEMROOT%\System32\SwitchVisibleUsers\
Create two files named hideusers.reg
and displayusers.reg
. These two files defines which users to hide/display at logon screen, edit contents to correspond your configuration.
Contents of hideusers.reg
:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList]
"Administrator"=dword:00000000
"ChuckNorris"=dword:00000000
"JonSkeet"=dword:00000000
And contents of displayusers.reg
:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList]
"Administrator"=dword:00000001
"ChuckNorris"=dword:00000001
"JonSkeet"=dword:00000001
Now, you're done. How to test it?
Just logout or switch user if fast user switching is enabled and when you are at logon screen try to use accessibility options (small button at left bottom corner). If Administrator, Chuck Norris or Jon Skeet is nearby, they will appear and disappear while you are clicking this magic button.
Best Answer
Go to Start > Control Panel > Administrative Tools > Local Security Policy
Select Security Settings > Local Policies > Security Options
Look for "Interactive logon: Do not display last user name"