Jump to content

Does anyone know of a good batch file syntax which will hibernate a machine?


Recommended Posts

Posted

Gurus,

 

Does anyone know of a good batch file syntax which will hibernate a machine?

 

--

Spin

  • Replies 11
  • Created
  • Last Reply
Guest Nepatsfan
Posted

Re: Does anyone know of a good batch file syntax which will hibernate a machine?

 

"Spin" <Spin@spin.com> wrote in message

news:62mlh0F24dq5hU1@mid.individual.net...

> Gurus,

>

> Does anyone know of a good batch file syntax which will hibernate a machine?

>

> --

> Spin

 

 

As long as Hibernation is enabled in Power Options, the following command in a

batch file will cause the computer to hibernate.

 

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

 

If Hibernation isn't enabled, the computer will go into Standby mode. Take a

look at this article for more info.

 

How To Put the System into hibernation or Standby from Run menu

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

 

Good luck

 

Nepatsfan

Guest ManyBeers
Posted

RE: Does anyone know of a good batch file syntax which will hibernate

 

RE: Does anyone know of a good batch file syntax which will hibernate

 

 

 

"Spin" wrote:

> Gurus,

>

> Does anyone know of a good batch file syntax which will hibernate a machine?

>

> --

> Spin

>

Sorry i don't know how to do batch files, but if you run

this:%windir%\system32\rundll32.exe powrprof.dll,SetSuspendState Hibernate

as a scheduled task it will hibernate your computer at whatever date/time

you want.

Guest Nepatsfan
Posted

Re: Does anyone know of a good batch file syntax which will hibernate a machine?

 

"Spin" <Spin@spin.com> wrote in message

news:62mlh0F24dq5hU1@mid.individual.net...

> Gurus,

>

> Does anyone know of a good batch file syntax which will hibernate a machine?

>

> --

> Spin

 

 

I almost forgot, you can also use PsShutdown.

 

PsShutdown v2.52

http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx

 

Good luck

 

Nepatsfan

Guest ManyBeers
Posted

Re: Does anyone know of a good batch file syntax which will hibern

 

Re: Does anyone know of a good batch file syntax which will hibern

 

 

 

"Nepatsfan" wrote:

> "Spin" <Spin@spin.com> wrote in message

> news:62mlh0F24dq5hU1@mid.individual.net...

> > Gurus,

> >

> > Does anyone know of a good batch file syntax which will hibernate a machine?

> >

> > --

> > Spin

>

>

> I almost forgot, you can also use PsShutdown.

>

> PsShutdown v2.52

> http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx

>

> Good luck

>

> Nepatsfan

>

>

Hey Nepatsfan, how come when i use %windir%\system32\rundll32.exe

powrprof.dll,SetSuspendState to hibernate my computer it does so but my

wake-up scheduled task doesn't run? In fact because of this i asked the same

question in Aumha forums and one of their experts pointed me to Shutter.exe

which i now use to hibernate my laptop and my wake-up scheduled task works.

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

wake-up task.

Guest Nepatsfan
Posted

Re: Does anyone know of a good batch file syntax which will hibern

 

Re: Does anyone know of a good batch file syntax which will hibern

 

"ManyBeers" <ManyBeers@discussions.microsoft.com> wrote in message

news:FF5B1332-EC6E-469A-8291-8845AF384E9D@microsoft.com...

>

>

> "Nepatsfan" wrote:

>

>> "Spin" <Spin@spin.com> wrote in message

>> news:62mlh0F24dq5hU1@mid.individual.net...

>> > Gurus,

>> >

>> > Does anyone know of a good batch file syntax which will hibernate a

>> > machine?

>> >

>> > --

>> > Spin

>>

>>

>> I almost forgot, you can also use PsShutdown.

>>

>> PsShutdown v2.52

>> http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx

>>

>> Good luck

>>

>> Nepatsfan

>>

>>

> Hey Nepatsfan, how come when i use %windir%\system32\rundll32.exe

> powrprof.dll,SetSuspendState to hibernate my computer it does so but my

> wake-up scheduled task doesn't run? In fact because of this i asked the same

> question in Aumha forums and one of their experts pointed me to Shutter.exe

> which i now use to hibernate my laptop and my wake-up scheduled task works.

> %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState blocks my

> wake-up task.

 

 

I'm not familiar with Shutter.exe so I can't comment on how or why it works for

you. If I get a chance, I'll install it on my test system and see exactly how it

operates. I'm curious to see if it's possible to start a computer with a

scheduled task. Call me a skeptic on this one.

 

It's always been my understanding that a system in a state of hibernation can

only be scheduled to power up through settings in the BIOS. The Setup program

for many systems has a section where you can schedule the computer to start

automatically.

 

I'm certainly no expert, but what you're describing goes against my

understanding of the power states available on a computer. When you set a

computer to hibernate, it's essentially shutdown. Since Windows isn't running,

how does it launch a scheduled task? I'll have to see if this Shutter.exe

program actually puts the computer in hibernation and not standby.

 

If I find out anything interesting, I'll get back to you.

 

Nepatsfan

Guest throwitout
Posted

Re: Does anyone know of a good batch file syntax which will hibern

 

Re: Does anyone know of a good batch file syntax which will hibern

 

On Feb 28, 1:19 am, "Nepatsfan" <nepats...@SBXXXIX.com> wrote:

> "ManyBeers" <ManyBe...@discussions.microsoft.com> wrote in message

>

> news:FF5B1332-EC6E-469A-8291-8845AF384E9D@microsoft.com...

>

>

>

>

>

> > "Nepatsfan" wrote:

>

> >> "Spin" <S...@spin.com> wrote in message

> >>news:62mlh0F24dq5hU1@mid.individual.net...

> >> > Gurus,

>

> >> > Does anyone know of a good batch file syntax which will hibernate a

> >> > machine?

>

> >> > --

> >> > Spin

>

> >> I almost forgot, you can also use PsShutdown.

>

> >> PsShutdown v2.52

> >>http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx

>

> >> Good luck

>

> >> Nepatsfan

>

> > Hey Nepatsfan, how come when i use %windir%\system32\rundll32.exe

> > powrprof.dll,SetSuspendState to hibernate my computer it does so but my

> > wake-up scheduled task doesn't run? In fact because of this i asked the same

> > question in Aumha forums and one of their experts pointed me to Shutter.exe

> > which i now use to hibernate my laptop and my wake-up scheduled task works.

> > %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState blocks my

> > wake-up task.

>

> I'm not familiar with Shutter.exe so I can't comment on how or why it works for

> you. If I get a chance, I'll install it on my test system and see exactly how it

> operates. I'm curious to see if it's possible to start a computer with a

> scheduled task. Call me a skeptic on this one.

>

> It's always been my understanding that a system in a state of hibernation can

> only be scheduled to power up through settings in the BIOS. The Setup program

> for many systems has a section where you can schedule the computer to start

> automatically.

>

> I'm certainly no expert, but what you're describing goes against my

> understanding of the power states available on a computer. When you set a

> computer to hibernate, it's essentially shutdown. Since Windows isn't running,

> how does it launch a scheduled task? I'll have to see if this Shutter.exe

> program actually puts the computer in hibernation and not standby.

>

> If I find out anything interesting, I'll get back to you.

>

> Nepatsfan

 

I know the program wosb (WakeupOnStandBy) can schedule a machine to

power back on if it's put in standby or hibernate. Nice interface too,

you can use either the GUI or the commandline:

 

http://www.dennisbabkin.com/php/download.php?what=WOSB

Posted

Re: Does anyone know of a good batch file syntax which will hibernatea machine?

 

Re: Does anyone know of a good batch file syntax which will hibernatea machine?

 

Take your pick

http://www.google.com/search?hl=en&q=command+line+hibernate

 

Spin wrote:

> Gurus,

>

> Does anyone know of a good batch file syntax which will hibernate a

> machine?

>

Guest throwitout
Posted

Re: Does anyone know of a good batch file syntax which will hibern

 

Re: Does anyone know of a good batch file syntax which will hibern

 

On Feb 28, 1:19 am, "Nepatsfan" <nepats...@SBXXXIX.com> wrote:

> "ManyBeers" <ManyBe...@discussions.microsoft.com> wrote in message

>

> news:FF5B1332-EC6E-469A-8291-8845AF384E9D@microsoft.com...

>

>

>

>

>

> > "Nepatsfan" wrote:

>

> >> "Spin" <S...@spin.com> wrote in message

> >>news:62mlh0F24dq5hU1@mid.individual.net...

> >> > Gurus,

>

> >> > Does anyone know of a good batch file syntax which will hibernate a

> >> > machine?

>

> >> > --

> >> > Spin

>

> >> I almost forgot, you can also use PsShutdown.

>

> >> PsShutdown v2.52

> >>http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx

>

> >> Good luck

>

> >> Nepatsfan

>

> > Hey Nepatsfan, how come when i use %windir%\system32\rundll32.exe

> > powrprof.dll,SetSuspendState to hibernate my computer it does so but my

> > wake-up scheduled task doesn't run? In fact because of this i asked the same

> > question in Aumha forums and one of their experts pointed me to Shutter.exe

> > which i now use to hibernate my laptop and my wake-up scheduled task works.

> > %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState blocks my

> > wake-up task.

>

> I'm not familiar with Shutter.exe so I can't comment on how or why it works for

> you. If I get a chance, I'll install it on my test system and see exactly how it

> operates. I'm curious to see if it's possible to start a computer with a

> scheduled task. Call me a skeptic on this one.

>

> It's always been my understanding that a system in a state of hibernation can

> only be scheduled to power up through settings in the BIOS. The Setup program

> for many systems has a section where you can schedule the computer to start

> automatically.

>

> I'm certainly no expert, but what you're describing goes against my

> understanding of the power states available on a computer. When you set a

> computer to hibernate, it's essentially shutdown. Since Windows isn't running,

> how does it launch a scheduled task? I'll have to see if this Shutter.exe

> program actually puts the computer in hibernation and not standby.

>

> If I find out anything interesting, I'll get back to you.

>

> Nepatsfan

 

Since the poster was nice enough to post a link to this Aumha

discussion, it was no problem finding out what shutter.exe is.

 

At first when I searched for it I got an 11MB photo editing program,

then I found this:

http://www.autohotkey.net/~bLisTeRinG/shutter.html

 

It looks like it's just wraping the Autohotkey shutdown calls, and

basically it looks comparable to PsShutdown. In scripts I'd normally

use either Nircmd or Autoit shutdown calls which amount to the same

thing. WOSB is also capable of sending the computer to standby or

hibernate.

 

As far as resuming from standby, as I mentioned before the program

wosb is capable of doing this, and Windows Task scheduler, and others

might as well. It looks like the API calls CreateWaitableTimer, and

SetWaitableTimer are used for this. If there's a WaitableTimer it will

bring the computer out of standby or hibernate.

 

As far as why his computer was failing to come out, looking at the

SetSuspendState Information:

http://msdn.microsoft.com/library/en-us/power/base/setsuspendstate.asp

 

There's additional options for standby or hibernate, as well as

"DisableWakeEvent". My guess is that when called from rundll it

defaults to disabling wake events. I can't seem to successfully feed

rundll the additional parameters (and neither can anyone it seems) so

there doesn't seem to be a way to control this behaviour using Rundll

directly.

Guest throwitout
Posted

Re: Does anyone know of a good batch file syntax which will hibern

 

Re: Does anyone know of a good batch file syntax which will hibern

 

On Feb 28, 10:13 am, throwitout <throwit...@dodgeit.com> wrote:

> On Feb 28, 1:19 am, "Nepatsfan" <nepats...@SBXXXIX.com> wrote:

> > "ManyBeers" <ManyBe...@discussions.microsoft.com> wrote in message

> Since the poster was nice enough to post a link to this Aumha

> discussion, it was no problem finding out what shutter.exe is.

>

> At first when I searched for it I got an 11MB photo editing program,

> then I found this:http://www.autohotkey.net/~bLisTeRinG/shutter.html

 

Or Shutter might be this:

http://www.den4b.com/projects.php

 

It's hard to tell.

Guest ManyBeers
Posted

Re: Does anyone know of a good batch file syntax which will hibern

 

Re: Does anyone know of a good batch file syntax which will hibern

 

 

 

"throwitout" wrote:

> On Feb 28, 10:13 am, throwitout <throwit...@dodgeit.com> wrote:

> > On Feb 28, 1:19 am, "Nepatsfan" <nepats...@SBXXXIX.com> wrote:

> > > "ManyBeers" <ManyBe...@discussions.microsoft.com> wrote in message

>

> > Since the poster was nice enough to post a link to this Aumha

> > discussion, it was no problem finding out what shutter.exe is.

> >

> > At first when I searched for it I got an 11MB photo editing program,

> > then I found this:http://www.autohotkey.net/~bLisTeRinG/shutter.html

>

> Or Shutter might be this:

> http://www.den4b.com/projects.php

>

> It's hard to tell.

Yes that is the one i use.

Guest ManyBeers
Posted

Re: Does anyone know of a good batch file syntax which will hibern

 

Re: Does anyone know of a good batch file syntax which will hibern

 

 

 

"throwitout" wrote:

> On Feb 28, 1:19 am, "Nepatsfan" <nepats...@SBXXXIX.com> wrote:

> > "ManyBeers" <ManyBe...@discussions.microsoft.com> wrote in message

> >

> > news:FF5B1332-EC6E-469A-8291-8845AF384E9D@microsoft.com...

> >

> >

> >

> >

> >

> > > "Nepatsfan" wrote:

> >

> > >> "Spin" <S...@spin.com> wrote in message

> > >>news:62mlh0F24dq5hU1@mid.individual.net...

> > >> > Gurus,

> >

> > >> > Does anyone know of a good batch file syntax which will hibernate a

> > >> > machine?

> >

> > >> > --

> > >> > Spin

> >

> > >> I almost forgot, you can also use PsShutdown.

> >

> > >> PsShutdown v2.52

> > >>http://technet.microsoft.com/en-us/sysinternals/bb897541.aspx

> >

> > >> Good luck

> >

> > >> Nepatsfan

> >

> > > Hey Nepatsfan, how come when i use %windir%\system32\rundll32.exe

> > > powrprof.dll,SetSuspendState to hibernate my computer it does so but my

> > > wake-up scheduled task doesn't run? In fact because of this i asked the same

> > > question in Aumha forums and one of their experts pointed me to Shutter.exe

> > > which i now use to hibernate my laptop and my wake-up scheduled task works.

> > > %windir%\system32\rundll32.exe powrprof.dll,SetSuspendState blocks my

> > > wake-up task.

> >

> > I'm not familiar with Shutter.exe so I can't comment on how or why it works for

> > you. If I get a chance, I'll install it on my test system and see exactly how it

> > operates. I'm curious to see if it's possible to start a computer with a

> > scheduled task. Call me a skeptic on this one.

> >

> > It's always been my understanding that a system in a state of hibernation can

> > only be scheduled to power up through settings in the BIOS. The Setup program

> > for many systems has a section where you can schedule the computer to start

> > automatically.

> >

> > I'm certainly no expert, but what you're describing goes against my

> > understanding of the power states available on a computer. When you set a

> > computer to hibernate, it's essentially shutdown. Since Windows isn't running,

> > how does it launch a scheduled task? I'll have to see if this Shutter.exe

> > program actually puts the computer in hibernation and not standby.

> >

> > If I find out anything interesting, I'll get back to you.

> >

> > Nepatsfan

>

> Since the poster was nice enough to post a link to this Aumha

> discussion, it was no problem finding out what shutter.exe is.

>

> At first when I searched for it I got an 11MB photo editing program,

> then I found this:

> http://www.autohotkey.net/~bLisTeRinG/shutter.html

>

> It looks like it's just wraping the Autohotkey shutdown calls, and

> basically it looks comparable to PsShutdown. In scripts I'd normally

> use either Nircmd or Autoit shutdown calls which amount to the same

> thing. WOSB is also capable of sending the computer to standby or

> hibernate.

>

> As far as resuming from standby, as I mentioned before the program

> wosb is capable of doing this, and Windows Task scheduler, and others

> might as well. It looks like the API calls CreateWaitableTimer, and

> SetWaitableTimer are used for this. If there's a WaitableTimer it will

> bring the computer out of standby or hibernate.

>

> As far as why his computer was failing to come out, looking at the

> SetSuspendState Information:

> http://msdn.microsoft.com/library/en-us/power/base/setsuspendstate.asp

>

> There's additional options for standby or hibernate, as well as

> "DisableWakeEvent". My guess is that when called from rundll it

> defaults to disabling wake events. I can't seem to successfully feed

> rundll the additional parameters (and neither can anyone it seems) so

> there doesn't seem to be a way to control this behaviour using Rundll

> directly.

 

That is what i was thinking too. The "DisableWakeEvent" parameter is enabled

by default. I was thinking there would be some key in the registry that would

have those parameters and i could change the "DisableWakeEvent" parameter to

false.

Maybe you can figure it out . Thanks for looking in to it.


×
×
  • Create New...