• Welcome to Tux Reports: Where Penguins Fly. We hope you find the topics varied, interesting, and worthy of your time. Please become a member and join in the discussions.

How to code batch file to hibernate XP with SP3?

E

Eric

Flightless Bird
Does anyone have any suggestions on how to code batch file to hibernate XP
with SP3?
Thanks in advance for any suggestions
Eric
 
V

VanguardLH

Flightless Bird
Eric wrote:

> Does anyone have any suggestions on how to code batch file to hibernate XP
> with SP3?


To go into Hibernate mode (provided you enabled it in Power Options):

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

If you want to go into Standby mode instead of Hibernate:

powercfg -h off
%windir%\system32\rundll32.exe powrprof.dll,SetSuspendState
powercfg -h on

This turns off hibernation mode, puts the host into a suspend state (which
will be standby power mode), and reenables hibernate mode afterward.

See: http://support.microsoft.com/kb/555569

All that above was found just by Google searches. It still works.
 
E

Eric

Flightless Bird
I would like to apply hibernate function instead of shutdown function, as
shown below, but I would like to keep this line as a reference for selections.
Do you have any suggestions on what to add in front of this line? so window
will recognize it as a comment, not a command.
Thank you very much for any suggestions
Eric

C:/WINDOWS\system32\shutdown.exe -s -t 01



"VanguardLH" wrote:

> Eric wrote:
>
> > Does anyone have any suggestions on how to code batch file to hibernate XP
> > with SP3?

>
> To go into Hibernate mode (provided you enabled it in Power Options):
>
> %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState
>
> If you want to go into Standby mode instead of Hibernate:
>
> powercfg -h off
> %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState
> powercfg -h on
>
> This turns off hibernation mode, puts the host into a suspend state (which
> will be standby power mode), and reenables hibernate mode afterward.
>
> See: http://support.microsoft.com/kb/555569
>
> All that above was found just by Google searches. It still works.
> .
>
 
B

BillyBob

Flightless Bird
Eric,

It seems that you just absolutely refuse to use Google to search for
answers. I can only assume you still like to be spoon fed.
Even VanguardLH mentioned that you could have found all the information you
need using Google. Well, he was nice and provided you with the answer and
then recommended Google. I, on the other hand, will recommend Google and
*not* give you the answer.

So, Google "how to add a comment in a batch file" and you will have your
answer in about 120 microseconds.


"Eric" <Eric@discussions.microsoft.com> wrote in message
news:B4042B0D-5D57-46AF-B3E2-E151AE3430F9@microsoft.com...
>I would like to apply hibernate function instead of shutdown function, as
> shown below, but I would like to keep this line as a reference for
> selections.
> Do you have any suggestions on what to add in front of this line? so
> window
> will recognize it as a comment, not a command.
> Thank you very much for any suggestions
> Eric
>
> C:/WINDOWS\system32\shutdown.exe -s -t 01
>
>
>
> "VanguardLH" wrote:
>
>> Eric wrote:
>>
>> > Does anyone have any suggestions on how to code batch file to hibernate
>> > XP
>> > with SP3?

>>
>> To go into Hibernate mode (provided you enabled it in Power Options):
>>
>> %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState
>>
>> If you want to go into Standby mode instead of Hibernate:
>>
>> powercfg -h off
>> %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState
>> powercfg -h on
>>
>> This turns off hibernation mode, puts the host into a suspend state
>> (which
>> will be standby power mode), and reenables hibernate mode afterward.
>>
>> See: http://support.microsoft.com/kb/555569
>>
>> All that above was found just by Google searches. It still works.
>> .
>>
 
A

Asger-P

Flightless Bird
Hi Eric

Den 23.04.2010 kl. 07:14 skrev Eric <Eric@discussions.microsoft.com>:

REM C:/WINDOWS\system32\shutdown.exe -s -t 01

or

:: C:/WINDOWS\system32\shutdown.exe -s -t 01


Best regards
Asger-P
 
A

Asger-P

Flightless Bird
Hi BillyBob

Den 23.04.2010 kl. 09:38 skrev BillyBob <billybob@has.onetooth>:

> Eric,
>
> It seems that you just absolutely refuse to use Google to search for
> answers. I can only assume you still like to be spoon fed.
> Even VanguardLH mentioned that you could have found all the information
> you need using Google. Well, he was nice and provided you with the
> answer and then recommended Google. I, on the other hand, will
> recommend Google and *not* give you the answer.
>
> So, Google "how to add a comment in a batch file" and you will have your
> answer in about 120 microseconds.


You are of course right about the possibility to use Google,
but I really think You should consider NOT chasing people out
of these groups. Just let people that cant answer the difficult
questions answer the easy ones, that way we all get to help
each other and the NG will be a live much longer.


P.s. It would be nice though if an experienced user such as Your
self, trimmed Your quotes to: "only whats needed".

Best regards
Asger-P
 
V

VanguardLH

Flightless Bird
Eric wrote:

> VanguardLH wrote:
>
>> Eric wrote:
>>
>>> Does anyone have any suggestions on how to code batch file to hibernate XP
>>> with SP3?

>>
>> To go into Hibernate mode (provided you enabled it in Power Options):

<snip - the commands needed to hibernate from a command line>
>> See: http://support.microsoft.com/kb/555569
>>
>> All that above was found just by Google searches. It still works.

>
> I would like to apply hibernate function instead of shutdown function, as
> shown below, but I would like to keep this line as a reference for selections.
> Do you have any suggestions on what to add in front of this line? so window
> will recognize it as a comment, not a command.
>
> C:/WINDOWS\system32\shutdown.exe -s -t 01


Gee, you really don't have much initiative.

There are lots of online tutorials available on how to write batch scripts:
http://www.google.com/search?q=+tutorial++batch+script++windows+command+shell

To figure out how to insert comments in a batch file:
http://www.google.com/search?q=+batch+script++windows++comments

Google still works.
 
T

Twayne

Flightless Bird
In news:B4042B0D-5D57-46AF-B3E2-E151AE3430F9@microsoft.com,
Eric <Eric@discussions.microsoft.com> typed:
> I would like to apply hibernate function instead of
> shutdown function, as shown below, but I would like to keep
> this line as a reference for selections. Do you have any
> suggestions on what to add in front of this line? so window
> will recognize it as a comment, not a command.
> Thank you very much for any suggestions
> Eric
>
> C:/WINDOWS\system32\shutdown.exe -s -t 01


The OP wants Hibernate; shutdown.exe does not do hibernate; that's a
shutdown (-s) in one second (-01).

>
>
>
> "VanguardLH" wrote:
>
>> Eric wrote:
>>
>>> Does anyone have any suggestions on how to code batch
>>> file to hibernate XP with SP3?

>>
>> To go into Hibernate mode (provided you enabled it in
>> Power Options):
>>
>> %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState
>>
>> If you want to go into Standby mode instead of Hibernate:
>>
>> powercfg -h off
>> %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState
>> powercfg -h on
>>
>> This turns off hibernation mode, puts the host into a
>> suspend state (which will be standby power mode), and
>> reenables hibernate mode afterward.
>>
>> See: http://support.microsoft.com/kb/555569
>>
>> All that above was found just by Google searches. It
>> still works. .
 
V

VanguardLH

Flightless Bird
Twayne wrote:

> Eric typed:
>> I would like to apply hibernate function instead of shutdown function, as
>> shown below, but I would like to keep this line as a reference for
>> selections. Do you have any suggestions on what to add in front of this
>> line? so window will recognize it as a comment, not a command.
>>
>> C:/WINDOWS\system32\shutdown.exe -s -t 01

>
> The OP wants Hibernate; shutdown.exe does not do hibernate; that's a
> shutdown (-s) in one second (-01).


For some reason, he wants to keep the command in his batch file for later
reference but he does NOT want to use it for what he wants now. So he
asked on how to leave the command but *comment* it out.
 
T

Twayne

Flightless Bird
In news:hqu1nt$drt$1@news.albasani.net,
VanguardLH <V@nguard.LH> typed:
> Twayne wrote:
>
>> Eric typed:
>>> I would like to apply hibernate function instead of
>>> shutdown function, as shown below, but I would like to
>>> keep this line as a reference for selections. Do you have
>>> any suggestions on what to add in front of this line? so
>>> window will recognize it as a comment, not a command.
>>>
>>> C:/WINDOWS\system32\shutdown.exe -s -t 01

>>
>> The OP wants Hibernate; shutdown.exe does not do
>> hibernate; that's a shutdown (-s) in one second (-01).

>
> For some reason, he wants to keep the command in his batch
> file for later reference but he does NOT want to use it for
> what he wants now. So he asked on how to leave the command
> but *comment* it out.


Yes, you are right. What I meant was to point out that the command shown is
not capable of executing a Hibernate, in case someone was seeing it as
saying that. But I see now he actually clarified that, which I missed.
Maybe he wants to be able to switch between Hibernate and Shut Down by
moving the comment tags. That would sort of make sense, at least during
testing.

Regards,

Twayne`
 
U

Unknown

Flightless Bird
Regarding your clean? system with all those services and applications loaded
read the post by PSRUMBAUGH of 4/28/2010 at 12:36PM
"Twayne" <nobody@spamcop.net> wrote in message
news:u3BDDV94KHA.4264@TK2MSFTNGP02.phx.gbl...
> In news:hqu1nt$drt$1@news.albasani.net,
> VanguardLH <V@nguard.LH> typed:
>> Twayne wrote:
>>
>>> Eric typed:
>>>> I would like to apply hibernate function instead of
>>>> shutdown function, as shown below, but I would like to
>>>> keep this line as a reference for selections. Do you have
>>>> any suggestions on what to add in front of this line? so
>>>> window will recognize it as a comment, not a command.
>>>>
>>>> C:/WINDOWS\system32\shutdown.exe -s -t 01
>>>
>>> The OP wants Hibernate; shutdown.exe does not do
>>> hibernate; that's a shutdown (-s) in one second (-01).

>>
>> For some reason, he wants to keep the command in his batch
>> file for later reference but he does NOT want to use it for
>> what he wants now. So he asked on how to leave the command
>> but *comment* it out.

>
> Yes, you are right. What I meant was to point out that the command shown
> is not capable of executing a Hibernate, in case someone was seeing it as
> saying that. But I see now he actually clarified that, which I missed.
> Maybe he wants to be able to switch between Hibernate and Shut Down by
> moving the comment tags. That would sort of make sense, at least during
> testing.
>
> Regards,
>
> Twayne`
>
 
Top