Quickly locking your Windows PC


Okay, I know you can press Windows Key + L but I really like to have an icon in my taskbar for this little task so every time I install a Windows OS I tend to add this as one of my first tweaks. Why? Well I learnt early on at Microsoft that leaving your PC unlocked when you walk off to get coffee can result in email being sent from your account that can be quite embarrassing πŸ™‚

Here's how to create a quick lock app on your taskbar

  1. Right click on your deksotp and select New, Shortcut
  2. Paste this text in - rundll32.exe user32.dll,LockWorkStation
  3. Click next and type a name for the shortcut (e.g. Lock)
  4. Click finish
  5. You can right click on your new shortcut and change the icon (there is a lock icon as part of the collection in %SystemRoot%\system32\SHELL32.dll)
  6. Now drag the icon to your taskbar

Done πŸ™‚

Comments (12)
  1. oldnewthing says:

    The LockWorkStation function was not designed to be called by rundll32. You’re actually corrupting the stack.


  2. Aaron says:

    Isn’t windows key + L simpler.

  3. Jas Dhaliwal says:

    Here a few I use on my quick launch bar in addition to locking the computer.

    ** Shutdown **

    Create a new shortcut  and paste the following:

    %windir%system32shutdown.exe -s -t 0

    ** Reboot **  (No sarky comments please!

    %windir%system32shutdown.exe -r -t 0

  4. Weijun says:

    It would be much more comfortable if the icon (or any clickable area) can be placed at a corner of the screen. This way I just push the mouse to the extreme and click, no need to locate the cursor anymore.

  5. stevecla01 says:

    aaron – yep, definitely simpler but not always faster when I have the mouse in my hand

  6. stevecla01 says:

    nice additions Jas. surely that reboot one is just restart after you’ve installed some new graphics drivers πŸ˜›

  7. stevecla01 says:

    raymond – is there a better way?


  8. Jas Dhaliwal says:

    Oops, yep meant a restart.

    Bang on, Nvidia drivers and Bios updates always a pain and need a restart.

    I’ve not had time to source with the Vista ResKit but are there any nice shortcuts for Vista?

    One of my favourite tools on XP has always been robocopy.

    Fab tool which you can use to mirror drives, great for backup purposes…

    robocopy.exe /?  for useful switches..

    Au qualitaire

  9. I just saw a great tip on Steve Clayton's blog for quickly locking your Windows PC, so I just had

  10. ccatto says:

    Hey Now Steve,

    Nice to know.



  11. Will Hughes says:

    Hah, yes, always lock your PC regardless of how long you’re away from it.

    I learned this from a very young age (on NT4) at school. The principle has carried over since then – and folks are often puzzled as to why I’m always locking my PC when I’m no longer paying attention to it. Even my home ones πŸ™‚

Comments are closed.

Skip to main content