Is there a way to lock a Windows XP machine via the command line? The shutdown command doesn't have an option for it.
| |||
feedback
|
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.
(Source) | |||||||||||||||
feedback
|
|
If you have access to Visual Studio's C++ compiler here's the (extremely complicated) source:
| |||
|
feedback
|
|
Note that in Windows Vista/7, you can use the command If you use the | |||||
feedback
|
|
Why do you need this from the command line? Is this something you want for convenience so you can lock the workstation easily when you leave? Win+L will quickly lock the keyboard. | |||||||
feedback
|
|
You can also do this from a local machine to lock a remote workstation by using a UNC path:
Getting access denied with Windows 7 workstations, but works with Windows XP. | ||||
|
feedback
|
|
Since it's not recommended to run LockWorkStation via rundll32.exe, another solution is to use Wizmo. Just run:
| |||
|
feedback
|