PC Review


Reply
Thread Tools Rate Thread

How to code batch file to hibernate XP with SP3?

 
 
Eric
Guest
Posts: n/a
 
      23rd Apr 2010

Does anyone have any suggestions on how to code batch file to hibernate XP
with SP3?
Thanks in advance for any suggestions
Eric
 
Reply With Quote
 
 
 
 
VanguardLH
Guest
Posts: n/a
 
      23rd Apr 2010
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.
 
Reply With Quote
 
Eric
Guest
Posts: n/a
 
      23rd Apr 2010
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.
> .
>

 
Reply With Quote
 
BillyBob
Guest
Posts: n/a
 
      23rd Apr 2010
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" <(E-Mail Removed)> wrote in message
news:B4042B0D-5D57-46AF-B3E2-(E-Mail Removed)...
>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.
>> .
>>


 
Reply With Quote
 
Asger-P
Guest
Posts: n/a
 
      23rd Apr 2010

Hi Eric

Den 23.04.2010 kl. 07:14 skrev Eric <(E-Mail Removed)>:

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

or

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


Best regards
Asger-P
 
Reply With Quote
 
Asger-P
Guest
Posts: n/a
 
      23rd Apr 2010

Hi BillyBob

Den 23.04.2010 kl. 09:38 skrev BillyBob <(E-Mail Removed)>:

> 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
 
Reply With Quote
 
VanguardLH
Guest
Posts: n/a
 
      23rd Apr 2010
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=%2Btu...+command+shell

To figure out how to insert comments in a batch file:
http://www.google.com/search?q=%2Bba...ws+%2Bcomments

Google still works.
 
Reply With Quote
 
Twayne
Guest
Posts: n/a
 
      23rd Apr 2010
In news:B4042B0D-5D57-46AF-B3E2-(E-Mail Removed),
Eric <(E-Mail Removed)> 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. .




 
Reply With Quote
 
VanguardLH
Guest
Posts: n/a
 
      24th Apr 2010
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.
 
Reply With Quote
 
Twayne
Guest
Posts: n/a
 
      24th Apr 2010
In news:hqu1nt$drt$(E-Mail Removed),
VanguardLH <(E-Mail Removed)> 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`


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code batch file? Eric Windows XP General 24 26th Apr 2010 02:47 PM
How to code a batch file? Eric Windows XP General 19 27th Mar 2010 02:57 PM
Does anyone know of a good batch file syntax which will hibernate a machine? Spin Windows XP General 11 28th Feb 2008 03:47 PM
Want to run a DOS batch file (.bat) From Excel VBA code Cazayoux Microsoft Excel Programming 1 31st Jul 2006 10:45 PM
executing a batch file from code Sinex Microsoft C# .NET 2 16th Jun 2005 10:16 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:14 PM.