If you’re like most people, you use your computer for work, entertainment, and other activities. You want to be sure your computer is secure and that no one can access your files or steal your information. One way to do this is to lock your computer using the command prompt. To lock your computer using the command prompt, follow these steps:

  1. Open the command prompt by clicking on the Start button and typing “cmd” in the search box. When Command Prompt appears in the results list, right-click on it and select “Run as administrator.” This will open the command prompt with administrative privileges.
  2. Type “net stop wuauserv” at the command prompt and press Enter. This will stop all of Windows Update services.
  3. Type “net start wuauserv” at the command prompt and press Enter. This will start all of Windows Update services again.
  4. Type “regedit” at the command prompt and press Enter. This will open Registry Editor (regedit).
  5. Locate HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon Right-click on Winlogon and select New > DWORD (32-bit) Value Name: LogonNotifyType Value: 3 (0x03) Right-click on LogonNotifyType and select Modify… In Value Data field, type 3 (0x03) Click OK to close Registry Editor ..

One of the first rules of cyber security is to always lock your PC before stepping away. While it may not be the quickest way to lock your Windows 10 PC, you can do it using the Command Prompt.

Lock Your Windows 10 PC Using Command Prompt

First, open the Command Prompt on your PC by opening the “Start” menu, typing “cmd” in the Windows Search bar, and then selecting “Command Prompt” from the search results.

Command Prompt will now open. Here, run this command to lock your Windows 10 PC.

Once executed, your PC will be locked. You’ll have to sign back in with your PIN, password, or whatever sign-in method you usually use.

RELATED: How to Lock Your Windows 10 PC Remotely

Set the Lock Screen Timeout Setting Using Command Prompt

Once you’ve locked your PC, the lock screen will generally be displayed for a certain amount of time before it time outs. You can set the amount of time that needs to pass before timing out using the Command Prompt.

To do this, you’ll need to open Command Prompt as an admin. Do so by typing “cmd” in the Windows Search bar and then right-clicking “Command Prompt” from the results. Next, select “Run As Administrator” from the menu that appears.

With Command Prompt open, run this command.

Replace

Note: This command sets the lock screen timeout setting for your PC if it’s plugged up to a power source. To set the lock screen timeout setting for your PC if it’s running on battery, change/SETACVALUEINDEX to/SETDCVALUEINDEX and run the command as normal.

Next, run this command:

Now your lock screen will timeout after the set amount of time. Give it a try!