Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If my laptop is connected to power source and is not configured to sleep on lid close (it is connected to power source and is working, I don't want it to sleep. It's compiling my code) if I close the lid, laptop will do nothing. This works as expected, but actually if I have my laptop connected to power source in the office it will be good to lock it if I close a lid. So no one can just open the lid and see my unlocked desktop.

I searched Google and it says that correct use case is to manually lock laptop via Win + L every time before lid is closed. This is OK, but not very secure - after all, I can forget Win + L.

Is there any easy way (maybe some registry value or app) to configure windows laptop so it will lock on lid close even without sleep? Of course I can write app/powershell script for this task, but this is not suitable for non-programmers end users.

share|improve this question
1  
@harrymc We've literally just eliminated these sorts of meta tags you added. Please don't create new tags that – by themselves – are meaningless. Thanks! –  slhck Jan 2 '13 at 11:10
    
@slhck: No problem. I have added one back (but more precise). –  harrymc Jan 2 '13 at 11:57
    
@harrymc Yup, that's much better. Thank you :) –  slhck Jan 2 '13 at 12:22
    
For those interested, related question on SO here. –  Karan Jan 8 '13 at 17:24

10 Answers 10

up vote 10 down vote accepted
+150

There is no built in way to do this, but you could use LidLock for this purpose. It is a GUI tool which can help you what you want to achieve. You can also set it to start automatically with Windows start-up.

enter image description here

enter image description here

You can also set the timer for sleep/hibernate after locking the laptop.

You can read more about this on this article.

share|improve this answer
1  
Is it any website/github for this tool? Starting .exe from some .zip file from web archive is not very secure ^_^". –  Eye of Hell Jan 2 '13 at 20:54
    
@EyeofHell my apologies to not include the source. I edited it and insert the link of the source article. But its not a git-hub tool. –  avirk Jan 3 '13 at 5:53
    
No way to run this as a background UI-less service, right? –  ripper234 Sep 30 '13 at 12:46
  1. Using Run from the start menu, execute regedit.

  2. Navigate to

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Power
    
  3. Right click > New > DWORD (32 bits)

  4. Rename it to AwayModeEnabled

  5. Select it > Right click > Change value to 1 (Hexadecimal)

  6. Go to the Power Options settings page and change the lid close action to sleep.

Source: Microsoft Answers - Lock computer on lid close?

share|improve this answer
2  
Checked on Windows 8: Not working, closing lid does nothing: dl.dropbox.com/u/239055/win8_laptop_lid_close_problem.png –  Eye of Hell Oct 30 '12 at 15:53
    
this might be a stupid question bu have you tried restarting the pc and the trying to make it sleep ? when editing the registry restarting the pc is a good idea. if that doesn't help i don't know. –  Danny Oct 30 '12 at 16:19
3  
on another note consider adding the windows-8 tag to your question (and to the tile of your question) as a bonus you'll be participating in the windows 8 contest –  Danny Oct 30 '12 at 16:22
1  
Sure thing. I just restarted the laptop. closed lid, waited a few minutes and opened lid. Windows instantly displayed my desktop - so no sleep and no lock. Thanks about tag note, added it. –  Eye of Hell Oct 30 '12 at 16:28

Here is another way to do it:

Under Choose what closing the lid does, select Do nothing for When I close the lid option.

Now, go to Change screen saver, and select Wait: 1 minutes and check On resume, display logon screen

Now, after closing your lid, for one minute, nothing happens, then it gets locked.

Is that it? No, not exactly. This won't work when any program prevents screen saver: like windows media player or vlc etc.

So, I guess this isn't the perfect solution, but it is one :)

share|improve this answer
2  
This is a good method, but: 1. screen saver will also pop up if i don't close the lid. It's not desirable since laptops are often used for reading etc. 2. If laptop is left at public place, i will need to wait this 1 minute after closing lid before leaving room. Otherwise, it will be a great security hole - any child can open the laptop after i leave and gain access to all my private information. –  Eye of Hell Jan 1 '13 at 13:07

Following up on LordZardec's answer - someone else has rewritten that app to create an improved version - it's available at http://skoffie.servebeer.com/LidLock.exe

Note: I have not tested it yet. I also can't vouch for its safety. I did test it with MSE and on VirusTotal and it came up clean. However, it is a relatively new offering - mentioned in the http://akhaliq.com/?p=198 comments with a posting date of Dec. 1, 2012.

share|improve this answer
    
This one seems good - a tray icon is nice for reassurance. However, it doesn't have as many options as the one in avirk's post. It'll do the job for me, though. –  WindowsEscapist Jan 4 '13 at 1:46

There isn't a setting in windows to do that unfortunately, but someone did create an application that would do it for you. Just run this app and whenever you close the lid, it will lock your laptop.

Locking App Blog Post: http://akhaliq.com/?p=198

share|improve this answer

The answer seems to be to change the power plan settings.

On your More Power Options, go to the plan you're using now, click Change Plan Settings » Change Advanced Power Settings » Power Buttons and Lid and change to Never.

share|improve this answer
    
It seems that Windows 8 don't have "More Power Options" settings pane. How to find it? –  Eye of Hell Dec 31 '12 at 22:15
    
Click on the battery icon visible on the taskbar of your Windows 8 computer screen and choose "More power options". –  harrymc Jan 1 '13 at 17:42
    
It have only "Adjust Screen Brightness", "Power Options", "Windows Mobility Center" and "Turn System icons on or off" :(. I'm using Windows 8 Professional 64-bit bought from Microsoft and installed myself, no system modifications. –  Eye of Hell Jan 2 '13 at 11:15
    
Don't you have this option as found on this image? Weird. –  harrymc Jan 3 '13 at 16:58

Power Options--> Choose when to turn off the display (left hand side) --> Change advanced power settings --> Balanced --> Require password on --> *CHANGE NO TO YES*

share|improve this answer

This is actually built into the OS:

enter image description here

share|improve this answer
1  
Sorry, but i can't see anything about lock screen on your screenshot. Can you clarify, please? –  Eye of Hell Aug 25 '13 at 14:52
  • Go to Power Management
  • Choose your plan like Power Saver
  • Click Change plan parameters
  • On power settings plan click Change advanced power settings
  • Locate the power button and lid, then two options come up: button and lid.
  • Choose Lid and you will see the settings.

See also this video from Microsoft: Change what happens when you close your laptop

share|improve this answer

Go to Control Panel, making sure in the top right corner where is says view by you are on Large icons and not category.

Then click on power options chose the side where it says "Choose what closing lid does."

Select sleep for both Plugged in and On Battery press Save Changes

Now open Control Panel again (still in large icon view) click on User Account then click on "Make changes to my account in PC settings"

Where it says "Require password after the display has been off for:" change this to Always require password

You are now done, so now when you shut your lid this will cause your computer to sleep which will cause your computer to lock.

share|improve this answer
    
But the question explicitly says: "I don't want it to sleep". (Also, sorry, but the above is very hard to read. What about adding some paragraphs by using a blank line? And starting sentences with upper case characters?) –  Arjan Sep 15 '13 at 12:17
    
As i mentioned in my question, i don't want it to sleep: it's compiling code, so sleep = bad. –  Eye of Hell Sep 15 '13 at 12:35

protected by Community Oct 11 '13 at 14:08

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.