SEARCH

How-To Geek

Create a Shortcut for Locking Your Computer Screen in Windows 7 or Vista

The quickest way to lock your computer screen is to just use the Win+L keyboard shortcut. Some people prefer to use the mouse to lock the workstation, however, or would just like to have both options.

Here’s how to easily create a shortcut to lock Windows 7, Vista, or even Windows XP as well.

Right-click wherever you want to create the shortcut, choose New, and then Shortcut.

Enter the following text into the shortcut textbox. Note that the screen will look different on Windows XP, but the same text should work.

rundll32.exe user32.dll, LockWorkStation

Enter a name for the shortcut, and then click Finish. That’s about all there is to it.

Lowell Heddings, better known online as the How-To Geek, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on if you'd like.

  • Published 04/10/07

Comments (20)

  1. Rene

    Thanks for this… Getting pulled away from the office all the time, it’s nice to just go over and double click something on my way out…

  2. Sheila

    Once you lock your computer using the shortcut, how do you unlock the computer again so that you can use it.

  3. Maurice Anthony

    this is one of the best websites i have seen for help in os related issues thanks
    i will refer to this website if any problems-

  4. Milee

    I need to keep system task in my computer because I need shortcut way but I can’t find that…….so please help me..

  5. Joyce Tucker

    How do I unlock my computer on startup?

    Thank You

    jkt41@yahoo.com

  6. Mark Searle

    That’s well handy, really like that one!!
    Even easier now i’ve moved the shortcut into the quicklaunch next to the start menu!!

  7. pixlez3n

    @Joyce Tucker – It brings you to the Welcome screen. You just have to log back in.

  8. bushman

    If however you have your username log on set to automatically sign you into Vista, then you’ll have to do a complete system shutdown from your hardware power button/switch. Then when you restart your computer it’ll bring you back to the Welcome Screen.

  9. Miles

    another way to do this quickly and easily is to use this hotkey:
    winkey+L
    no space need be taken up, no creating anything needed. its alll there. :)

  10. Spacegold

    Sheila asked the right question over a year ago and no one answered. What good is a lock icon without a way to unlock? I use the automatic logon, so I never see the welcome screen.

  11. jd2066

    @Spacegold: When it’s locked you get taken to the login screen regardless of auto login, where you then type your password to unlock it.
    Note: If you have press Ctrl-Alt-Del on login enabled you will have to press it on the lock screen too.

  12. Odge

    You could also use the windows key and L combo

  13. John

    Here’s how to make it look better!!!
    after you finish making the icon right click it and then click “Change Icon” then in the “Look for Icons in this file” box copy and paste this…
    %SystemRoot%\System32\imageres.dll
    then look for the lock… makes it look a LOT better!!

  14. victor kruger

    great website i love it, great how you have lots of screen shots and its step by step, brilliant web site i only hope it get better which i think it will.

  15. Merlin

    Or you can just use Windows Key + L

  16. Ricky

    This WEBSITE ROCKS.THANKYOU GEEK!!You guys have all the answers. CAN YOU HAVE A SEPERATE SECTION FOR TROUBLE SHOOTING.
    THANKS ONCE AGAIN.

  17. amrit singh

    i am very getting this tips……so i want to say Thanks GEEK!!!
    i have a question also… how we lock the USB port to the gust user so that gust user could not interact with computer?

  18. SouseMouse

    I googled “Windows-7 lock-screen shortcut” and got the answer I wanted here. I’m normally a big fan of the Win+L method, but I don’t have a keyboard on my Windows machine. I use Synergy from my Linux box, and it doesn’t successfully pass the Win+L combo, so having an icon to do it saves me from having to go through the start menu. Thanks!

  19. iphoness

    Thanx for your energy, sustain the nice operate Excellent perform

  20. Siva

    Nice Work..Chill….!

Enter Your Email Here to Get Access for Free:

Go check your email!