I'm a longtime Linux user, and I just recently got a laptop that runs Windows 7. I recently stepped away from my workstation for a few minutes, and returned to find, to my horror, someone else sitting at my laptop watching a video on YouTube. It seems like they hadn't done anything else, but the possibility that they could have quickly browsed through my saved passwords or something still concerns me. I'm so used to all my Linux machines locking the instant I close the lid, I hadn't even considered the possibility that it wouldn't happen in Windows. As it turns out, I can't even find an option to make it happen.

I've seen a couple sketchy-looking programs I can run in the background that will supposedly achieve what I need. Is that really the only way to secure my machine? I don't want the computer to sleep or hibernate every time I close the lid. Is there something in the control that will help out that I just missed? If not, what program or other solution would you recommend?


2 Answers 2


I believe you can change some registry settings to have the PC lock when you shut the lid:

  1. Launch registry (start > regedit)
  2. Local the following: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Power
  3. Right Click > New > DWORD (32 bits)
  4. Rename it to AwayModeEnabled
  5. Select AwayModeEnabled > Right Click > Change value to 1 (hexadecimal)
  6. Go to Power Options and change the lid close action to Sleep.

This should have 'tricked' the OS into locking the PC when the lid is closed (rather than putting this to sleep).

Please backup your registry before making any changes just in case you change the wrong thing.

  • This is an interesting little hack that appears to mostly work, but if the computer is playing any audio it gets muted (not paused) when the lid is closed. Any idea how to fix that?
    – Dan
    Commented Jan 20, 2014 at 22:01
  • Not too sure if this will pause the music but you could try right clicking on the sound icon, click on Playback Devices. There should be a tab that says "Communications" on the very right. Change the option to "Do Nothing". This will either stop the music completely or continue playing.
    – user95184
    Commented Jan 20, 2014 at 22:07
  • That doesn't seem to have changed a thing.
    – Dan
    Commented Jan 20, 2014 at 22:17
  • I'm not 100% sure then. The thing is, with changing the above registry key, this still keeps some settings from the Windows sleep mode so it'll be hard to change all. I'll try and have a play around if I can do this. Does the PC lock fine though?
    – user95184
    Commented Jan 20, 2014 at 22:21
  • Yeah, the audio issue is the only thing I've noticed. I'll go ahead and accept your answer since it does technically answer the question as I asked it, but I'd really appreciate a solution to the audio thing if you can come up with anything.
    – Dan
    Commented Jan 20, 2014 at 22:43

You might want to look at related question: How to Lock (not sleep) laptop on lid close?

I wrote a very lightweight application called LapLock that achieves the behavior you're looking for. Unfortunately there doesn't seem to be a clean way to do this without resorting to a third-party application.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .