Automatically lock screen on lid close in Windows 7

11

1

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?

Dan

Posted 2014-01-20T21:28:05.170

Reputation: 314

Answers

6

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.

Joe S

Posted 2014-01-20T21:28:05.170

Reputation: 570

Can the same be applied to Windows 8? – Montag451 – 2015-04-14T09:01:24.813

@Montag451 - Possibly; I haven't tested this on Windows 8 and unfortunately don't have a Windows machine to test. Backup your registry and give it a go! – Joe S – 2015-04-20T18:46:57.887

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 – 2014-01-20T22:01:42.553

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. – Joe S – 2014-01-20T22:07:28.370

That doesn't seem to have changed a thing. – Dan – 2014-01-20T22:17:02.067

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? – Joe S – 2014-01-20T22:21:03.963

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 – 2014-01-20T22:43:03.077

Away Mode seems to specifically turn off all video and audio since its use case is for leaving Media Centers for recording without bugging user with screen or sounds http://blogs.msdn.com/b/david_fleischman/archive/2005/10/21/483637.aspx

If you really need to keep the sound, perhaps there's no other option than using those 'sketchy' apps. Or changing your habit to Win-L first before closing the lid.

– Martheen Cahya Paulo – 2014-01-21T03:00:23.137

1

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.

Etienne Dechamps

Posted 2014-01-20T21:28:05.170

Reputation: 1 662