How to code batch file to hibernate XP with SP3?

E

Eric

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

Eric said:
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

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
 
B

BillyBob

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.
 
A

Asger-P

Hi Eric

Den 23.04.2010 kl. 07:14 skrev Eric <[email protected]>:

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

Hi BillyBob

Den 23.04.2010 kl. 09:38 skrev BillyBob said:
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

Eric said:
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

In
Eric said:
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).
 
V

VanguardLH

Twayne said:
Eric typed:

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

In
VanguardLH said:
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

Regarding your clean? system with all those services and applications loaded
read the post by PSRUMBAUGH of 4/28/2010 at 12:36PM
 

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