See how you can use the Command Prompt to lock your Windows PC.
One of the first rules of safety, especially if you're at work, is to always lock your computer before you leave.
There are many ways to do this, some easy and some quite complicated, but today we will learn how it can be done using the Command Prompt.
Faster way
For the completeness of the article, the simplest way is to press the keys simultaneously Win + L. Second faster way is to press the keys Ctrl + Alt + Delete and select “Lock”.
Directly with CMD
But for those who want to play with Cmd, then do the following:
Open the Command Prompt on your computer and type the command
Rundll32.exe user32.dll,LockWorkStation
Once you press enter, your computer will be locked and you will see your familiar screen asking for your password.
Alternatively with CMD
Alternatively, you could create a permanent command on your desktop with a beautiful icon that locks your computer whenever you press it.
-
On your desktop, right-click your mouse, then New, then Shortcut.
-
In the field that says "Enter the location of the item" type
C:\Windows\System32\rundll32.exe user32.dll,LockWorkStation
and click the Next button. -
Type a name for your shortcut, for example “Lock” and click the “Done” button.
-
Double clicking on it will lock your computer. If you want you can change its icon to make it more beautiful.