How to Lock Your Windows 10 PC with Command Prompt
One of the key rules of cybersecurity is to always lock your PC when stepping away. Although it may not be the fastest method, you can lock your Windows 10 PC using the Command Prompt.
Lock Your Windows 10 PC with Command Prompt
To start, open the Command Prompt by clicking the Start menu, typing “cmd” in the search bar, and selecting Command Prompt from the results.
Command Prompt will now open. Here, run this command to lock your Windows 10 PC.
Rundll32.exe user32.dll,LockWorkStation
Once the command is executed, your PC will lock, and you’ll need to sign back in using your PIN, password, or whichever sign-in method you normally use.
Set the Lock Screen Timeout Using Command Prompt
After locking your PC, the lock screen will stay visible for a set amount of time before timing out. You can adjust how long this screen stays on using Command Prompt.
To do this, you need to run Command Prompt as an administrator:
- Type “cmd” in the Windows search bar.
- Right-click on Command Prompt from the search results.
- Choose Run as Administrator from the menu that appears.
With Command Prompt open, run this command.
powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK <time>
Replace <time> with your desired amount of time in seconds. That means if you want to time out the lock screen after two minutes, you’d enter this command:
powercfg.exe /SETACVALUEINDEX SCHEME_CURRENT SUB_VIDEO VIDEOCONLOCK 120
Next, run this command:
powercfg.exe /SETACTIVE SCHEME_CURRENT
Now, your lock screen will time out after the period you’ve set. Try it out and see the changes!
Unlock powerful features with a genuine Windows 10 Pro Key – get the best deal at the lowest price today!