Crimsonfox
Crimsonfox

Reputation: 422

Batch - Log off while locked

I want to run a silent installer, lock the computer, then when the install is complete, have the PC log off, while locked

The locking will be manual but the rest, ideally I would like to be done through a batch file. I've tried simply trying to set it to log off while locked and that doesn't work so I was wondering if there was a way around it.

Thanks in advance.

Upvotes: 0

Views: 442

Answers (1)

Werner Henze
Werner Henze

Reputation: 16761

You can lock the screen with rundll32.exe user32.dll,LockWorkStation, do your work and log the user off with shutdown /l. You might want to add /t xxx and /f to shutdown.exe.

Upvotes: 1

Related Questions