Hibernation Q

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Hibernation Q

Post by Me_again » Thu Jan 29, 2009 3:05 pm

Is there a way to anticipate hibernation and also recognize return from hibernation in order to trigger macros?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Thu Jan 29, 2009 3:30 pm

Rather than anticipate hibernation, I'd be inclined to control it.

First write a script that will start your hibernation based on the same criteria microsoft would use. Detect mouse and or keyboard inactivity and hibernate after a desired timeout. One such technique is discussed HERE

That same script then waits through the hibernation. Since your computer is basically powered off, the script is not running but will continue running when the system starts back up.

for example, this script will hibernate then display a message after you restart the system:

Code: Select all

Press lwinkey
Release lwinkey
Wait>0.5
Press Up
Wait>0.5
Press Enter
Wait>0.5
Send>h
Wait>0.5
Press Enter
Wait>30
Message>no longer hibernating
Of course this script would be best if it were compiled and running full time in the background.

Sorry this is kind of sketchy but hopefully you get the idea.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu Jan 29, 2009 8:33 pm

Thanks Dick. Unfortunately controlling the hibernate isn't an option but I like the Wait> idea. That's much better than looking for a time written in a file which was what I had come up with for the wake part.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts