Make Windows Load Your Desktop Before You Log In

Make Windows Load Your Desktop Before You Log In

If you like to be able to step away from your computer while your desktop and programs load, but don’t want to enable the autologin feature, this script will begin loading your desktop when the login screen shows up.

Technically, this trick enables auto-login and then locks your computer as soon as it starts up, but it’s a clever workaround for this particular annoyance. All you need to do is create a new text file named LockWorkStation.vbs (or whatever else you want; just remember the name). Copy and paste this code into the file’s body:

WScript.CreateObject("WScript.Shell").Run("rundll32 user32.dll,LockWorkStation")

Go to Start > All Programs > Accessories > Run and type in control.exe userpasswords2. Hit Enter and uncheck the box that says “Users must enter a user name and password to use this computer”. Then hit up the Advanced tab and click on the Advanced button. In the left pane of the window that pops up, click on the Users folder and right click on the user for which you want this hack to apply. Click on Properties, go to the Profile tab, and type LockWorkStation.vbs in the Logon Script box (or whatever the name of your script is).

Next, drag the script to whatever folder you want to keep it in, right click on that folder and hit Properties. From the Sharing tab, click Advanced Sharing. Check the “Share this Folder” box and type in NetLogon in the Share Name box. Set the number of simultaneous users to 1, and hit Permissions to make sure that you are the only user listed and that read access is enabled. If it is, hit OK and save all your settings.

Now, whenever you log into Windows, Windows will start loading your desktop and login programs while the login box is on the screen. So, you can start up your computer, step away from your desk, and when you come back everything will be loaded and ready when you log in. Check out the video to watch the setup in action.

Windows Autologin Lock Screen [Mike McQuaid]


  • The equivalent for recent GNOME desktops (I checked on a beta Ubuntu 10.10):
    Go to System -> Preferences -> Startup Applications
    In the start applications preferences dialog, go to the Startup Programs tab and hit the Add button
    Give a descriptive name like “Lock screen on login”
    In the command field, enter “/usr/bin/gnome-screensaver-command -l”
    Save, and then close the startup applications preferences.
    Then configure GDM to log in as your user automatically (System -> Administration -> Login Screen)

  • Awww, didn’t work. I’m on Win7 on a domain and I think that’s why there isn’t an option to untick “Users must enter a user name and password to use this computer”. Pity, would have been fantastic.

    • You can still do this on a domain Arran, just not through the GUI. You’ll need to modify your registry:
      [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]

  • This doesn’t work for 32-bit Vista Home Premium.

    I get to the stage where I need to “Then hit up the Advanced tab and click on the Advanced button.”

    It says “This computer is running Windows Vista Home Premium. This snapin may not be used with this version of Windows. To manage user accounts for this computer, use the User Accounts tool in the Control Panel.”

    Any way to get around this?

    • Same issue with Win 7 Home Premium. I got a work around, by doing the following.

      After setting Windows to auto log-on, close the user accounts window, and open up the start menu. Navigate to all programs -> Startup, and right click on the Startup folder, and click on open. Then copy-paste the “LockWorkStation.vbs” file into the Startup folder. Now when Windows logs into your account, it should auto-execute the script, locking your computer. Well it worked for me at any rate.

      Hope it works for you.

    • @Raphael Pearce
      Exactly. This is not a good idea.

      From memory (Win XP days) you could log in, hit win+L and it would lock once it had ‘applied personal settings’.

      Don’t know if this is the same in Win7.

  • Anyone know how to uninstall this app without stuffing up something seriously? I have deactivated it but there is 16GB of content in a folder on my C: drive called LockWorkStation. Is this duplicate content that can be safely deleted is it going to destroy my Windows install? Thanks!

Log in to comment on this story!