I work in an IT Department and for years I've always had a piece of software called "cyt.exe". When ever I logged in someones computer as Admin, this software allowed me to log out with their username still in the log in text box. We recently upgrade a large quantity of systems to Wins7 and WinEmbedded7 and that program no longer works due to the registry change.
Currently the best I could to for replicating that software function as .bat file is:
call reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v LastLoggedOnSAMUser /t REG_SZ /d "domain/username" /f
call reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /v LastLoggedOnUser /t REG_SZ /d "doamain/username" /f
pause
When I log out, it leaves the user name and password blank which is OK but I need to take it one step further. I need the values of:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI
"LastLoggedOnSAMUser"="domain\username"
"LastLoggedOnUser"="domain\username"
to match the values that are in
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData\1
"LoggedOnSAMUser"="domain\username"
"LoggedOnUser"="domain\username"
Any suggestions on what I need to change in my code to manipulate the registry to match those values without having to manually input them?