How to Create a Shortcut to Lock Windows PC?

There are many reasons why to create a shortcut to lock a Windows computer. This article will tell you the easiest and fastest way to lock your Windows using a shortcut icon.

For example, sometimes you can be in a rush and have to leave your work right away. You must have forgotten to lock your computer.

You could have important data on your computer that can be stolen or seen by someone, if you are not at your desk and your Windows computer is in an unlocked state.

As a solution, you must be wondering about any way to lock your computer immediately before you leave your desk.

Hence, i will tell you the cool trick when you are running out of time in case of hurry wherein you can create a shortcut to lock your windows computer with just one click.

Follow the steps given below:

Create a Shortcut to Lock Windows

Step 1.  Right click anywhere on the Desktop screen where you can see an empty space, navigate the mouse cursor to New and select Shortcut

shortcut to lock computer

Step 2. A dialog box will be prompted on your screen. Type the following code or copy that and paste it into a blank dialog box and click the Next button.

rundll32 user32.dll,LockWorkStation

create shortcut to lock windows

Step 3. Type a name for the shortcut you desired in the Type a name for this Shortcut textbox.

Example: Lock My PC as mine in the image below then click on Finish.

create shortcut to lock computer

All done now.

From now on, if you are in a hurry or have to go away immediately, you will be able to lock your computer just by double clicking on the newly created shortcut on your Desktop.

Assign an Icon to Lock My PC Shortcut

For the next steps, you will see how to add an icon image to created shortcut to lock your computer.

However, it is not mandated to place an image there, if you want your shortcut icon to look stylish or good looking, you should follow the steps given below:

  1. Right-click on the created shortcut (Lock My PC) and select Properties

  2. Once the shortcut properties open, go to the Shortcut Tab and select the Change Icon


    3. On the change icon window, type or copy paste following C:\Windows\System32\imageres.dll and click OK.
    There are many default system icons that will appear. Select the desired icon that you want for the shortcut we have created and click OK again so the icon will be selected.


    4. Alright, now see if the selected image icon will be there. Now press OK in the previous window to close the shortcut properties.

Finally, look at the shortcut icon now.

Below is the final shortcut created to lock your Microsoft Windows PC immediately. If you are in a hurry, just double click and lock your computer instantly.

How to Create a Shortcut to Lock Windows PC? Click To Tweet

Share this post to help others!!

Leave a Reply