One of the first rules of cybersecurity is to always lock your computer before you leave. While this may not be the fastest way to lock your Windows 10 computer, you can do so with the command prompt.
Lock your Windows 10 computer with the command prompt
First open the command prompt on your computer by opening the “Start”; menu, typing “cmd” in the Windows search field, and then selecting “Command Prompt” from the search results.
The command prompt opens now. Here you run this command to lock your Windows 10 computer.
Once you have run it, your computer will be locked. You must log in again with your PIN code, password or which login method you usually use.
RELATED: How to lock your Windows 10 computer remotely
Set the timeout setting for the lock screen using the command prompt
Once you have locked your computer, the lock screen generally appears for some time before it shuts down. You can set how long it takes before you time out with the command prompt.
To do this, you must open the Command Prompt as an administrator. To do this, type “cmd” in the Windows search bar, and then right-click “Command Prompt” from the results. Then select “Run as administrator” from the menu that appears.
With the command prompt open, run this command.
powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK
with the desired time in seconds. This means that if you want to cancel the lock screen after two minutes, enter this command:
powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 120
Note: This command sets the lock screen timeout setting for your computer if it is connected to a power source. Change to set the lock screen timeout setting for your computer if it is running on battery power
/SETDCVALUEINDEX and run the command as usual.
Then run this command:
powercfg.exe /SETACTIVE SCHEME_CURRENT
Now your lock screen will time out after the set time. Give it a try!