There are two places that you can usually go to put your PC into sleep or hibernate mode, either the Shutdown option in the Start menu or the Shut Down Windows dialog box by pressing the Alt + F4 key combination on the desktop.
But if you want to do it from a command line so you can put it in a scheduled job or a batch file, you are out of luck but to look for the other alternatives. Here are 3 of them you can choose from.
- NirCmd – a small but powerful command line utility by NirSoft that also provides tons other useful utilities.
- PSShutdown – a small command line utility that is similar to Windows built-in shutdown utility. It’s part of the excellent Sysinternals suite.
- Wizmo – another extremely useful command line utility.
And now let’s see how they work in action.
Table of Contents
Put a Windows into Sleep
psshutdown - d
Put a Windows into hibernate
Well, the Windows built-in command line Shutdown does come with an option to hibernate a computer.
psshutdown - h
Turn off the monitor screen
nircmd monitor off
Log off the current user
nircmd exitwin logoff
Even though pressing Win + L is much easier, you can still do it with the command lines.
wizmo blandlock - to lock the screen and turn off the monitor