33

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.

harrymc
  • 498,455
grigoryvp
  • 1,057

10 Answers10

14

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.

avirk
  • 15,877
11

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.

11
  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?

Danny
  • 164
7

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

Prasanth
  • 570
-1

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
Kevin
  • 1,443
-1

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.

slhck
  • 235,242
Haven
  • 23
-1
  • 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

slhck
  • 235,242
-1

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

-3

This is actually built into the OS:

enter image description here

Jan Doggen
  • 4,657
Dennis
  • 3
-3

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.

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311