قالب وردپرس درنا توس
Home / Tips and Tricks / To lock your Windows 10 computer using the command prompt

To lock your Windows 10 computer using the command prompt



Windows 10 logo

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.

Open the command prompt from Windows Search

The command prompt opens now. Here you run this command to lock your Windows 10 computer.

Rundll32.exe user32.dll,LockWorkStation

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.

Open the command prompt as an administrator

With the command prompt open, run this command.

powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 

Replace 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

command to set the timeout timer for the lock screen

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/SETACVALUEINDEX to/SETDCVALUEINDEX and run the command as usual.

Then run this command:

powercfg.exe /SETACTIVE SCHEME_CURRENT

Final command for setting the lock screen timer

Now your lock screen will time out after the set time. Give it a try!




Source link