topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday March 19, 2024, 1:10 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: How to schedule hibernation On/Off so can run overnite once a week  (Read 13885 times)

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
    • View Profile
    • Donate to Member
If I use Hibernation to save power...how can I keep the PC running, or wake it up, for batch/maintenance jobs?  Generally I schedule this once a week...but not sure what to do if I also want to save power with hibernate mode.

thanks for any solutions/ideas....

Barret

cthorpe

  • Discount Coordinator
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 738
  • c++thorpe
    • View Profile
    • Donate to Member
I'm thinking maybe a AutoHotKey automation of opening power settings and disabling hibernate would do the trick.

These should work for Windows XP.  You may have to modify them for other flavors of windows.

Hibernate Off
WinWait, Program Manager,
IfWinNotActive, Program Manager, , WinActivate, Program Manager,
WinWaitActive, Program Manager,
Send, {LWINDOWN}r{LWINUP}
WinWait, Run,
IfWinNotActive, Run, , WinActivate, Run,
WinWaitActive, Run,
Send, powercfg.cpl{ENTER}
WinWait, Power Options Properties,
IfWinNotActive, Power Options Properties, , WinActivate, Power Options Properties,
WinWaitActive, Power Options Properties,
Send, {CTRLDOWN}{TAB}{TAB}{CTRLUP}{SPACE}{ENTER}


Hibernate On - Change the number of {UP} on the last line to adjust the hibernate time.
WinWait, Program Manager,
IfWinNotActive, Program Manager, , WinActivate, Program Manager,
WinWaitActive, Program Manager,
Send, {LWINDOWN}r{LWINUP}
WinWait, Run,
IfWinNotActive, Run, , WinActivate, Run,
WinWaitActive, Run,
Send, powercfg.cpl{ENTER}
WinWait, Power Options Properties,
IfWinNotActive, Power Options Properties, , WinActivate, Power Options Properties,
WinWaitActive, Power Options Properties,
Send, {CTRLDOWN}{TAB}{TAB}{CTRLUP}{SPACE}{ALTDOWN}a{ALTUP}{CTRLDOWN}{TAB}{TAB}{CTRLUP}{ALTDOWN}h{ALTUP}{UP}{UP}{UP}{UP}{UP}{ENTER}

You could compile those and then run them using Task Scheduler to stop the hibernation process.  The attached files should turn it off and turn it back on with a 3 hour delay.
« Last Edit: April 18, 2007, 12:19 PM by cthorpe »

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Do you use a network router?

If so you may be able to schedule the router to wake up your computer when you want. (My router has scheduling built into the config interface so it is easy to setup and means you wouldn't have to tweak your hibernation settings.) Remember to enable "Wake up on LAN" in your BIOS - that will depend on your BIOS settings and also what 'wake up' facilities are supported by your LAN card or WiFi adapter.

The system should then hibernate again when it has been 'on' for the usual time.
« Last Edit: April 18, 2007, 06:08 PM by Carol Haynes »

db90h

  • Coding Snacks Author
  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 481
  • Software Engineer
    • View Profile
    • Bitsum - Take control of your PC
    • Read more about this member.
    • Donate to Member
Correct me if I'm wrong, but the Windows XP Scheduler has a checkbox for scheduled items that allows you to indicate you want the computer woken up. From what sleep levels it will resume, I dunno.

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
I'm not sure but I don't think hibernation is a sleep state in that sense as you can remove power once it hibernated. Effectively the scheduler would need to be able to run when the system is powered down.

db90h

  • Coding Snacks Author
  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 481
  • Software Engineer
    • View Profile
    • Bitsum - Take control of your PC
    • Read more about this member.
    • Donate to Member
I'm not sure but I don't think hibernation is a sleep state in that sense as you can remove power once it hibernated. Effectively the scheduler would need to be able to run when the system is powered down.
-Carol Haynes (April 19, 2007, 04:23 AM)

Yea, I think you are right about not being able to wake up from hibernate, it does seem unlikely.

By 'sleep state' I was referring to sleep states S0-S5, of which hibernate is S4. So, its semantics there. Maybe the OP here doesn't really need to go to full hibernate -- especially if its a PC plugged into the wall. The power consumption is negligible with a lesser sleep state. Otherwise, I guess wake on lan is the best option, as a previous poster mentioned.

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
    • View Profile
    • Donate to Member
Hi and thanks for the help.   Based on some of the suggestions I found a BIOS upgrade to my dell allows me to turn it on (from shutdown state) at a predetermined time.  So that will be my solution for now.

I also have another PC that I'd like to power on for the same maintenance purposes..but have not found a bios upgrade for this pc that allows it to come alive.  So, am thinking to  use a 'Wake on Lan' signal sent to it.  I found some tools for sending a WOL packet  - from a linux box - but not from an XPHome box.  If anyone knows how to send a WOL packet from XPhome pls tell me.

thanks again to the helpful folks here at DonationCoder.

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Don't know whether it will work or not but why not get the Linux box to load a file from a shared folder on the XPHome box - I presume if the Linux box tries to access a network item on the XP box it should automatically wake up to service the request.

I may be a bit naive on that though!

222fbj

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 53
    • View Profile
    • Donate to Member
I don't have a linux box....just two XPhome PCs, and a Linksys router.

Carol Haynes

  • Waffles for England (patent pending)
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 8,066
    • View Profile
    • Donate to Member
Sorry I misread your message (the perils of speed reading).

Unless it is a very old computer it should have WOL as standard in the BIOS? Or does it not work with your network interface?

Are you using an internal PCI card? Sometimes they need a short lead to connect it to pins on the  motherboard  to enable WOL (the one I have from Belkin has a two core cable with a connector which only needs to be installed if you plan to use WOL). Might be worth checking the motherboard manual (downloadable from the mobo manufacturer's website) and your Network card manual to see if it can be done.

cthorpe

  • Discount Coordinator
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 738
  • c++thorpe
    • View Profile
    • Donate to Member
Re: How to schedule hibernation On/Off so can run overnite once a week
« Reply #10 on: April 20, 2007, 11:04 AM »
If the whole wake on lan thing doesn't work, I still think the AHK scripts I posted above could do what you need.  Set up the hibernate off to run sometime during the day that you want the machine to be on over night.  Then have the hibernate on script run sometime after you are sure that the scheduled tasks will be completed.  It results in a little more power consumption than a WOL solution, but it works.

Maggy160

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 12
    • View Profile
    • Donate to Member
I tested the hibernate on/off scripts and as I expected it doesn't wake up at the set time.
In hibernate mode the machine's state is only "active" as the hibersys.fil on harddisk. You can pull the plug with no effect, it'll wake up as usual. I'm even not able to charge my cell phone on USB while in hibernate.