Automatically logon to a user account on boot and then lock the desktop

Create a batch file with the following contents:




------

@ECHO OFF



%windir%\system32\rundll32.exe user32.dll,LockWorkStation

-----



Name the batch file "autolock.cmd". Move the batch file to the "c:\documents

and settings\\Start Menu\Programs\Startup" folder.



---



Another way is to create an entry in the Run section for the HKCU hive. You

would type the following into a Command Prompt window between the [ ] to add

the registry entry for the autolock entry.



[reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v autolock /t

REG_SZ /d "%windir%\system32\rundll32.exe user32.dll,LockWorkStation"]



Then to delete the autolock entry in the registry, simply type the following

between the [ ]:



[reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Run /v autolock]

Popular Posts