# Hibernate and Sleep command line prompts not working



## ppisciot (Jun 28, 2005)

Hibernate and Sleep command prompts not working 


I have created command prompt shortcuts for Shutdown, Restart, Hibernate and Sleep in Windows 8. Shutdown and Restart work fine. I created two icons:
Sleep: (,,,SetSuspendState 0,1,0) and Hibernate: (,,,SetSuspendState hibernate)
If I enable hibernate (powercfg -h on) then hibernate works but sleep also hibernates.
If I disable hibernate, the sleep works and hibernate does nothing.
The strange part is with hibernate ON, the command line for hibernate works and the sleep button in the Charms DOES put it to sleep and the hibernate command line works. 
So, my question is: what is different about the Charms Sleep button than the command line and how can I get a command line for both?
Any help would be appreciated. Thanks in advance.


----------



## OldGrayGary (Jun 29, 2006)

The trouble seems to be in the design of the interface itself. An article over at TechRepublic shows that the command for both hibernate & sleep are the same, but vary in their effect based on choices made in the Advanced Power Options menus (Control Panel app).

The command they seem to share:
rundll32.exe powrprof.dll,SetSuspendState

The effects are exactly as you describe, with hibernation enabled, you can allow Sleep from the Charms menu but not from the command line shortcut, while hibernation will work from both a Charms icon or a command line shortcut. I haven't yet found a command line solution.

With hibernate enabled, however, a few almost as quick solutions:
1) From the desktop (minimize any open windows first), use the* ALT* and *F4* key-combo to produce the shutdown menu, providing all options - shutdown, sleep, hibernate, restart, sign out (used to be called Log off), & Switch User.
2) Follow the steps in the Tech Republic article to attach a shutdown menu to the Windows 8 desktop --- Add a Shutdown menu to the Windows 8 desktop | TechRepublic

There is another article on the Computer Performance site in Great Britain that goes into great detail on the maze of power settings in Windows 8. Fair warning: it's rather hard to read that article with all the advertisements in the way, but the information itself is good stuff. --- Windows 8 Sleep Mode Hibernate Problem

Best of luck,
. . . Gary


----------



## ppisciot (Jun 28, 2005)

Thanks, Gary. I like the feature of adding a shutdown menu to the desktop. However, it poses the same problem that I can't have both a Hibernate and Sleep command on them. I will look at the other article when I get some extra time. I appreciate your help.
Pete


----------



## OldGrayGary (Jun 29, 2006)

I like the menu idea too. I was able to get both Sleep and Hibernate available from the ALT + F4 key combo menu, once I went into the Advanced options in the Control Panel's "Power Options" applet & specifically enabled Hibernation from there. 

But it looks like the techs at TechRepublic couldn't get both of those options onto their menu either. 

If I have some time later in the week, I might have another go at trying again.
(Though I do rather like the ease of the ALT + F4 combo .... it's just not as quick or elegant as a single icon to click ... after all, bringing up the Charms bar, clicking Power, then Sleep [or Hibernation, or whatever] isn't really much slower).

It is really aggravating, though, that Microsoft wasn't clever enough to know that this was going to be an issue for the majority of their customers (Most Windows users do not access Windows from a touchscreen device). Inelegant! Inefficient! And dangit - so far we can't fix it with a few simple commands. [the third party interfaces that restore the Windows 7 way of doing things do work (Start8 seems to be quite popular) ... but I prefer to work from within Microsoft's own framework ... less trouble with future Windows Updates, and more security - in general.

Never a dull moment.
. . . Gary


----------



## ppisciot (Jun 28, 2005)

It is just very strange that the Charms sleep command works and if I connect a keyboard that has a Sleep button on it, it also works. I wish there was a way to find out what command those are sending to the OS. Oh well, I guess another one of those things I'll have to learn to live with. Just annoying. 
Pete


----------

