Step 1: First of all, right-click anywhere on your desktop and select New > Shortcut.
Step 2: On the “Type the location of the item” field, enter the path – Rundll32.exe user32.dll,LockWorkStation Step 3: Once done, click on the ‘Next‘ button. Step 4: Now in the ‘Type a name for this shortcut’ field, enter ‘Lock’ and click on the ‘Finish‘ button. Step 5: Now you will find a Lock Shortcut icon on the desktop. Right-click on it, and select ‘Properties‘ Step 6: Click on the ‘Change icon’ button and browse the icon that resembles the lock option best for you. Step 7: Once done, right-click on the shortcut file, and select ‘Pin to taskbar’ or ‘Pin to Start’ Step 8: Now, whenever you want to lock your PC, click on the Taskbar lock icon.