FG
💻 Software

Command-line (cmd) command to lock a windows machine

Fresh7 days ago
Mar 15, 2026234825 views
Confidence Score1%
1%

Problem

Is there a way to lock a Windows XP machine via the command line? The command doesn't have an option for it.

Error Output

shutdown

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Command-line (cmd) command to lock a windows machine

Low Risk

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 use could shatter the universe! Nudar: Got it. Two or three times. (Source)

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment