Home » Questions » Computers [ Ask a new question ]

How can I put the computer to sleep from Command Prompt/Run menu?

How can I put the computer to sleep from Command Prompt/Run menu?

I know that almost everything on Windows, like opening any sort of application, can be done from the command prompt or from the Run menu.

Asked by: Guest | Views: 98
Total answers/comments: 5
Guest [Entry]

"You will find shutdown.exe to be your friend.

Other handy commands see this post:

Sleep Computer (read more at superuser.com/a/463652/249349 )

Lock Workstation

Hibernate Computer - see answers by Scott Chamberlain and Eric L.

Restart Computer

Shutdown.exe -r -t 00

Shutdown Computer

Shutdown.exe -s -t 00

EDIT/UPDATE:

It seems that sleeping a computer is problematic if hibernate is turned on.

Copying from other answers:

You can either try PsShutdown or:

The command rundll32.exe powrprof.dll,SetSuspendState 0,1,0 for sleep is correct - however, it will hibernate instead of sleep if you don't turn the hibernation off.

Here's how to do that:

Go to the Start Menu and open an elevated Command Prompt by typing cmd.exe, right clicking and choosing Run as administrator. Type the following command:

powercfg -hibernate off"
Guest [Entry]

"The command rundll32.exe powrprof.dll,SetSuspendState 0,1,0 for sleep is correct - however, it will hibernate instead of sleep if you don't turn the hibernation off.

Here's how to do that:

Go to the Start Menu and open an elevated Command Prompt by typing cmd.exe, right clicking and choosing Run as administrator. Type the following command:

powercfg -hibernate off"
Guest [Entry]

"See the free utility of Wizmo, which can do very many things.
The command you're looking for is probably:

wizmo standby"
Guest [Entry]

"You can initiate the suspend or hibernate options from the command line as specified below and referenced in this article.

%windir%\System32\rundll32.exe powrprof.dll,SetSuspendState

If your computer is set to allow hibernation then the above command will initiate hibernation. If the hibernation feature is disabled, then it will enter the standby state. As other users have answered previously, shutdown.exe /? will provide many shutdown options."
Guest [Entry]

"You must first disable Hibernate in windows and then put the computer in Sleep state. Use following two commands:

powercfg -hibernate off
rundll32.exe powrprof.dll,SetSuspendState 0,1,0

and for doing reverse action, Hibernating the computer, use commands below:

powercfg -hibernate on
rundll32.exe powrprof.dll,SetSuspendState Hibernate"