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.

10 Answers 10


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.

  • 2
    Is it any website/github for this tool? Starting .exe from some .zip file from web archive is not very secure ^_^". – grigoryvp 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
  • @ripper234: if you're looking for an equivalent application that is more lightweight and doesn't have an UI, you might be interested in LapLock which I describe in my other answer. – Etienne Dechamps Aug 13 '16 at 9:28
  1. Using Run from the start menu, execute regedit.

  2. Navigate to

  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?

  • 3
    Checked on Windows 8: Not working, closing lid does nothing: dl.dropbox.com/u/239055/win8_laptop_lid_close_problem.png – grigoryvp 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. – grigoryvp Oct 30 '12 at 16:28
  • didn't work on Win10 even after restart. no extra option appeared on the drop down on 'lid close action' – Odys Sep 6 '17 at 11:06

I wrote an alternative to the LidLock application suggested in other answers, called LapLock. What it does is simply listen for the lid close event and lock the computer when the event fires. Compared to LidLock mine is very bare-bones (it doesn't even have a UI), but also more lightweight.


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 :)

  • 4
    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. – grigoryvp Jan 1 '13 at 13:07

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.

  • It seems that Windows 8 don't have "More Power Options" settings pane. How to find it? – grigoryvp Dec 31 '12 at 22:15
  • 1
    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. – grigoryvp 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
  • 1
    Changing the plan this setting to "Never" will not make the computer lock itself when the lid is closed. Therefore this is not an answer to the question. – Etienne Dechamps Aug 13 '16 at 9:24

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

  • 1
    At least here on Windows 10, there is no "Require password on" setting in the power plan advanced setting list. – Etienne Dechamps Aug 13 '16 at 9:26
  • 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

  • 1
    The settings you're referring to do not include a "lock" option (only sleep, hibernate or shut down). Therefore you are not answering the question. – Etienne Dechamps Aug 13 '16 at 9:36

Window 10 RS4, enable a screensaver with a 3 minute timeout is my solution to a secure desktop/laptop. Sleep is no good for productivity apps running in the background. Closing the lid no longer has this basic option ... AwayModeEnabled did not work either.

> Right click on desktop
> Personalize
> Lock screen
> Screen saver settings
> Select your favourite design
> Wait 3 minutes
> On resume, display the logon screen

This is actually built into the OS:

enter image description here

  • 5
    Sorry, but i can't see anything about lock screen on your screenshot. Can you clarify, please? – grigoryvp Aug 25 '13 at 14:52

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.

  • 1
    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
  • 1
    As i mentioned in my question, i don't want it to sleep: it's compiling code, so sleep = bad. – grigoryvp Sep 15 '13 at 12:35

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