Automatically Login and Lock Windows 8 on Startup

Print View Mobile View

If you have automatic logon enabled, you may turn on your computer and leave afterwards for other activities while post-logon start up items are started. And when you comeback your PC is completely booted up, ready for you to start your work. The problem with this is that unless you remember to lock your PC, your account is accessible to all while you’re away.
The other scenario, that is if you’ve not configured auto login, would be that you’ll have to manually login and wait while the system gets ready. This can be quite annoying and time consuming as well. So here’s a solution, in fact 3 solutions, for you.

Using any of the methods shown in this post, you’re automatically logged into your Windows account and then auto locked as well. That basically means, no more annoying waiting time, and your system stays in a secured state until you login yourself.

First of all, lets enable automatic logon for your Windows 8 account.

  1. Run “netplwiz.exe” in Run dialog.
  2. Uncheck the box that says “Users must enter a user name and password to use this computer” and click OK.
  3. Enter your password.
  4. Click OK again to close the User Accounts dialog.

Once enabled, use a method that works right for you:

Method 1: Using Startup Folder Shortcut

We will create a simple shortcut in the startup folder, that when run, locks your PC. To do so, follow these steps:

  1. Open your startup folder (Run dialog>shell:startup)
  2. Create a new shortcut pointed to: C:\Windows\System32\rundll32.exe User32.dll,LockWorkStation
  3. Auto lock shorcut

  4. Give the shorct a name such as ‘Auto Lock”, and save changes.

That’s it. Now your computer will login, then lock, but continue to load everything Windows needs or is supposed to do.

This was the simplest solution of all mentioned here, but is also the least secure. If you have many programs scheduled to run at Windows startup then it may take a while before this shorcut is run. Till then your computer stays unlocked.

Method 2: Using Task Scheduler

In this method we will create a scheduled task that is triggered by Windows logon.


  1. Run Task Scheduler by entering Taskschd.msc in Run dialog box.
  2. Now create a new task using the Basic Taks Wizard (Actions > Create Basic Task…)
  3. Give a name to the task.
  4. Trigger: When I log on.
  5. Action: Start a program.
  6. Program: rundll32.exe.
  7. Arguments: user32.dll,LockWorkStation.
  8. Auto lock scheduled task

  9. Hit Finish to save the task

The rundll32 command is executed immediately on automatic logon, and locks your PC. This is before executing File Explorer, so is the safest solution without depeneding on external tools.

Method 3: Using Auto Logon & Lock Program

This method makes use of a little program called Auto Logon & Lock. This program locks the desktop before Explorer is started, and it password protects Safe Mode as well.


  1. Download Auto Logon & Lock and extract to a folder on your computer.
  2. You’ll find two files named “Lock.exe” and “LockCMD.exe” inside the folder. Copy these files to your Windows directory (Ex: C:\Windows).
  3. Then run “lockcmd.reg”, and click Yes in the dialog box to add the entries to your registry.

That’s it. You’re good to go.

To uninstall the program, run “uninstall_lockcmd.reg” file, and delete the two files that you’d earlier copied to the Windows directory.

This post is aimed at Windows 8 users, however, all methods should work perfectly on other Windows versions as well.