Take the 2-minute tour ×  Is there a way to lock a Windows XP
machine via the command line? The shutdown command doesn't have
an option for it.  share|improve this question From a Remote
Desktop session, you should be able to use
<kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>END</kbd> to show the
Windows Security screen (where you can lock your workstation,
restart, etc.). In Vista or above, you can also select "Windows
Security" from the Start Menu. !Windows Security menu item – 
bobbymcr Aug 29 '09 at 17:37 add comment  6 Answers  up vote 44
down vote accepted rundll32.exe user32.dll,LockWorkStation  I've
been warned that this isn't recommended (except by Microsoft).
The warnings are also centered around the command's close
relative, ExitWindowsEx (Which shuts down the computer). I've
never had any issues with it, but YMMV.  Schlump: The poodle-
monkey may be right. The legend warns that the code is powerful
and dangerous. Nudar: My God. We'd better use it only three or
four times. Six, max. Nibbler: But even a single