47

I could lock my Windows XP workstation using CTRL+ALT+DEL, K. That keystroke combination does not work on Windows 7. Is there a method of locking Windows 7 using just keystrokes?

oKtosiTe
  • 9,408
  • 9
  • 46
  • 70
zundarz
  • 1,155
  • 5
  • 14
  • 24

4 Answers4

127

Windows key+L should do what you need.

oKtosiTe
  • 9,408
  • 9
  • 46
  • 70
Trey
  • 1,229
  • 1
  • 9
  • 8
  • 50
    It's worth mentioning that this isn't a new shortcut to Windows 7... it has been around since at least the XP days. Check out the "Windows key" Wikipedia page for other useful shortucts that use this key: http://en.wikipedia.org/wiki/Windows_key – Jesse Webb Mar 19 '13 at 22:43
  • 9
    My habit: try *every* `Windows key` + letter combination and see what they do whenever a new Windows version is released. – Alvin Wong Mar 20 '13 at 06:03
  • 5
    @Alvin and not only letter: the win+arrowkey have nice features too. – Konerak Mar 20 '13 at 07:01
  • 2
    Win+M (or Win+D), Win+L, and Win+R are the big three for me *(Also Win-P, when I used to have a laptop)* – BlueRaja - Danny Pflughoeft Mar 20 '13 at 07:16
  • 2
    @AlvinWong , you can also check [here](http://support.microsoft.com/kb/126449) or [here for Win8](http://windows.microsoft.com/en-us/windows-8/new-keyboard-shortcuts#1TC=t1) for a complete list, or in the Windows manual (printed or online). Should be easier than _trying_. – Jcl Mar 20 '13 at 07:38
  • @AlvinWong yeah, I only said it was easier ;-) – Jcl Mar 20 '13 at 12:23
  • Uh-oh. My windows key is not working. This post is rubbing salt in my long-forgotten wounds. – Anurag Kalia Mar 20 '13 at 22:52
  • @AnuragKalia Windows key can be replaced by Ctrl+Esc. Unfortunately I haven't find a way to replace Windows in a compound key, except remapping the keys – phuclv Mar 15 '17 at 16:39
16

Use Windows+L. If you use AutoHotKey you can reprogram Windows+L to do other things too, like lock your session, and also wait 10 seconds and put monitors to sleep. Powerful little hotkey program.

oKtosiTe
  • 9,408
  • 9
  • 46
  • 70
Pat
  • 815
  • 9
  • 17
12

Also, Ctrl+Alt+Del, Enter   and   Ctrl+Alt+Del, Alt+K seem to work for me.

  • 1
    Ctrl-Alt-Del Enter is the way. This has worked across various versions of Windows for a long time, since the default button on the Ctrl-Alt-Del screen is "Lock this computer". – Kaz Mar 20 '13 at 01:35
  • 2
    Also Space instead of Enter works as well, since it's the default highlighted item. – Viper_Sb Mar 20 '13 at 05:22
  • 5
    Wouldn't Ctrl+Alt+Del Alt+K depend on one's installed/selected language variant, though? – user Mar 20 '13 at 12:03
  • @MichaelKjörling: (1) Good point.  I hadn’t consciously considered that.  You are probably right.  (2) I’ll fall back on @Kaz and @Viper’s suggestions that (Enter) and (Space) are the universal answers.  (3) Since the OP said that `K` worked for him on Windows XP, I believe that it’s quite likely that ***he*** is an English user. – Scott - Слава Україні Mar 21 '13 at 00:42
  • @Kaz: and `Windows+L` hasn't worked for a long time across Windows versions? Don't remember about Windows 2000, but at least since XP this worked fine. – 0xC0000022L Mar 21 '13 at 02:43
  • -1 for unnecessarily involved way to do it. Surprised you didn't know Windows + L. – Austin ''Danger'' Powers Jun 28 '13 at 23:56
  • @Austin''Danger''Powers: Gosh.  (1) The OP seemed to be interested in (Ctrl+Alt+Del) + K solutions.  (2) Trey had already answered (Windows+L) by the time I answered.  And (3) I ***did*** know about (Win+L) before I read Trey’s answer; but see (1). – Scott - Слава Україні Jun 29 '13 at 00:05
  • 4 keystrokes vs 2 keystrokes. These are SHORTcuts we're talking about here. Key combinations that make doing routine tasks quick, easy, and effortless. Windows + L is also much easier to remember for non techie types. – Austin ''Danger'' Powers Jun 29 '13 at 00:14
5

You can even use a simple batch file. Just double click on it & your PC will get locked. Just copy & paste the below code in to Notepad & save it as (for example) "lock.bat". That's it - you're done, just double click on it.

The code is:

@echo off
rundll32.exe user32.dll, LockWorkStation
cls
Sunil
  • 85
  • 2
  • 11
    This is over-involved and doesn't answer the question. – Dane Mar 20 '13 at 13:05
  • 3
    Also, you really shouldn't use rundll32 on things that weren't made for rundll32 (and those are deprecated since Vista) See also: http://blogs.msdn.com/b/oldnewthing/archive/2004/01/15/58973.aspx (Sadly down at the moment) – 3Doubloons Mar 20 '13 at 13:41
  • @AlexBrault Working fine for me now. – user Mar 20 '13 at 14:56
  • If you put this file on your Desktop and assign a Shortcut key (combination) to it, then that keystroke combination will lock the workstation.  It must be Ctrl+Alt+(something) or Ctrl+Shift+Alt+(something).  You might need to logout and login again before it becomes effective. – Scott - Слава Україні Mar 21 '13 at 00:50
  • This code is great when you are trying to plug this into a macro key on your keyboard. Thanks Sunil. – Josh Simar Apr 19 '16 at 17:29
  • create a link/shortcut with the command, no need to turn echo off or clear screen, and assign a shortcut key to that shortcut. Now you have a shortcut to do whatever you want – phuclv Mar 15 '17 at 16:42
  • @3Doubloons' link is still broken but you can read the blog post at https://web.archive.org/web/20151205153714/http://blogs.msdn.com/b/oldnewthing/archive/2004/01/15/58973.aspx – rkagerer Jul 12 '20 at 15:41
  • The updated link is https://devblogs.microsoft.com/oldnewthing/20040115-00/?p=41043 (Though there are no comments and they are closed so there's no real difference from the archive) That said, 7 years later, I'm not sure why I linked that article and not this one: https://devblogs.microsoft.com/oldnewthing/20130104-00/?p=5643 (Probably because the former explicitly calls out LockWorkStation as a bad idea) – 3Doubloons Jul 13 '20 at 19:34