If my laptop is plugged in I want closing the lid to automatically lock the computer, without putting it to sleep. I don't see an option to do this in Power Options:
Is there a hack to achieve this?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
As far as I know, there is no built-in function to achieve this. But you can do this using a third party tool.
Download the program - https://github.com/dechamps/laplock/releases
(Download the latest laplock.exe release)
Open the Windows Startup folder by using this run command - '
Add laplock.exe to your Startup folder.
You can also use Lid Lock to do this.
Set "Do Nothing", lock your laptop using Windows key+L, and then you can close the lid.
From those sources, we can use
GUID_LIDSWITCH_STATE_CHANGE to detect the trigger, and run:
from the command line to send a lock screen request to the machine.
I don't know what compilers you have available, or what languages you know, but this information should help you set up a program to do it for you.
I don't use Windows myself, so I can't build or test it for you.