Need commend to put computer into StandBy

G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.general (More info?)

I'm aware of the Shutdown command.

I'm wondering if there is a command to put the computer into StandBy mode?

How about Hibernate?


Thanks
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.general (More info?)

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.


--
--------------------------------------------------------------------------------------------------
http://webdiary.smh.com.au/archives/_comment/001075.html
=================================================
" **Developer**" <REMOVEdeveloper@a-znet.com> wrote in message news:%23KkBnh4cFHA.2760@tk2msftngp13.phx.gbl...
> I'm aware of the Shutdown command.
>
> I'm wondering if there is a command to put the computer into StandBy mode?
>
> How about Hibernate?
>
>
> Thanks
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.windowsxp.general (More info?)

I think it just what I need

I tried it once and it when into hibernation

Thanks

"David Candy" <.> wrote in message
news:OmDw5o4cFHA.3912@TK2MSFTNGP15.phx.gbl...
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.


--
--------------------------------------------------------------------------------------------------
http://webdiary.smh.com.au/archives/_comment/001075.html
=================================================
" **Developer**" <REMOVEdeveloper@a-znet.com> wrote in message
news:%23KkBnh4cFHA.2760@tk2msftngp13.phx.gbl...
> I'm aware of the Shutdown command.
>
> I'm wondering if there is a command to put the computer into StandBy mode?
>
> How about Hibernate?
>
>
> Thanks
>
>