Fix Hibernate Command Line

N

nemy35

About 2 months ago I ran across a hibernate shortcut for Hibernating my
computer with one click that I copied to my Desktop. It has been working
fine, but now something changed. It still Hibernates my PC with the
"Preparing to Hibernate" message, turning the computer off, & "Resuming
Windows" message when I turn the computer back on, but no longer allows my
computer to wake up to run scheduled programs that ran before. Start/Turn
Off Computer/Shift Key Hibernate key sequence works (indicating Hibernate is
OK ) allowing the computer to wake up for my scheduled programs to run, so
the shortcut must be corrupted.

The shortcut is C:\%windir%\system32\rundll32.exe PowrProf.dll
SetSuspendState.

Can anyone tell me what is missing or what should be changed in the shortcut
to make it work again?

Thanks
 
D

David Candy

You can't change anything about it.
rundll32 Powrprof.dll,SetSuspendState

Note I can't guarantee it will always work. As we're passing Null, Null, Null. to a function that expects values.


Platform SDK: Hardware

SetSuspendState
The SetSuspendState function suspends the system by shutting power down. Depending on the Hibernate parameter, the system either enters a suspend (sleep) state or hibernation (S4). If the ForceFlag parameter is TRUE, the system suspends operation immediately; if it is FALSE, the system requests permission from all applications and device drivers before doing so.

BOOL SetSuspendState (
BOOL Hibernate,
BOOL ForceCritical,
BOOL DisableWakeEvent
);
Parameters
Hibernate
[in] Specifies the state of the system. If TRUE, the system hibernates. If FALSE, the system is suspended.
ForceCritical
[in] Forced suspension. If TRUE, the function broadcasts a PBT_APMSUSPEND event to each application and driver, then immediately suspends operation. If FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation.
DisableWakeEvent
[in] If TRUE, the system disables all wake events. If FALSE, any system wake events remain enabled.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
An application may use SetSuspendState to transition the system from the working state to the standby (sleep), or optionally, hibernate (S4) state. This function is similar to the SetSystemPowerState function.
 
N

nemy35

I have never used the Software Developers Kit you mention, so forgive me if
I reflect a non-complete understanding of all that you've said, but is there
a way to add the effect of SetWakeEventEnabled to the shortcut command line,
so the computer will always wake up using the shortcut no matter what state
other calls are in or have gone through??


"David Candy" <.> wrote in message
You can't change anything about it.
rundll32 Powrprof.dll,SetSuspendState

Note I can't guarantee it will always work. As we're passing Null, Null,
Null. to a function that expects values.


Platform SDK: Hardware

SetSuspendState
The SetSuspendState function suspends the system by shutting power down.
Depending on the Hibernate parameter, the system either enters a suspend
(sleep) state or hibernation (S4). If the ForceFlag parameter is TRUE, the
system suspends operation immediately; if it is FALSE, the system requests
permission from all applications and device drivers before doing so.

BOOL SetSuspendState (
BOOL Hibernate,
BOOL ForceCritical,
BOOL DisableWakeEvent
);
Parameters
Hibernate
[in] Specifies the state of the system. If TRUE, the system hibernates. If
FALSE, the system is suspended.
ForceCritical
[in] Forced suspension. If TRUE, the function broadcasts a PBT_APMSUSPEND
event to each application and driver, then immediately suspends operation.
If FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each
application to request permission to suspend operation.
DisableWakeEvent
[in] If TRUE, the system disables all wake events. If FALSE, any system
wake events remain enabled.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error
information, call GetLastError.

Remarks
An application may use SetSuspendState to transition the system from the
working state to the standby (sleep), or optionally, hibernate (S4) state.
This function is similar to the SetSystemPowerState function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top