Lock your Windows XP session

October 2016

A Windows XP session can be locked easily. By doing this, any unauthorized access to the system can be prevented. There are several ways to implement this. Through the shortcut option you get when you right click on the desktop, Windows XP can be locked. Another method is to create a batch file with extension name .bat in Notepad. Alternatively, the use of DOS can also be helpful in locking the session and maintaining privacy.

There are several ways available to be able to lock Windows XP (including Home Edition and XP Pro)

Method 1: Shortcut

  • Right click on your desktop and select New > Shortcut from the list
  • Copy and paste the command rundll32.exe user32.dll, LockWorkStation and click "Next"
  • You can choose to label the shortcut before choosing the "Finish" option

Method 2: Using DOS

  • Go to the "Start" button and choose the "Run" option
  • Type in "CMD" and when the command window pops up, copy and paste rundll32.exe user32.dll, LockWorkStation before pressing the Enter key

Method 3: Create a .bat file

  • Open a new Notepad document and copy and paste the command

@echo off     
rundll32.exe user32.dll, LockWorkStation     
  • Save the text file as a .bat file
  • Once done, all you have to do is to run the file by double clicking on it

Related :

This document entitled « Lock your Windows XP session » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.