How can I run scripts when entering or existing Hibernation?
I need a hook so that when a Windows 7 Pro SP1 32 or 64 bit system goes into Hibernation I can either run a script or kill a process. I also need a hook so that when a Windows 7 Pro SP1 32 or 64 bit system comes out of Hibernation I can either run a script or relaunch a process. Can anyone tell me how to do this?
March 4th, 2011 4:27pm

Take a look into the Task Scheduler. (type task in the search) I think you can probably use the "on event" trigger, but I see problems with the "goes into hibernation" requirement you have. After all, if you get the event for hibernation (I'm assuming there is one, I personally don't hibernate or "sleep" any of my machines, EVER), isn't it too late to execute anything? On the other hand, (again assuming there is an event, I tend to think there is) the one coming out of hibernation should be cake. So the outstanding questions are: Does hibernation generate an event, and if so what is it's ID? Is there an event for "getting ready to hibernate", and if so, what is it's ID? If you can answer these two (really 4) questions, Task Scheduler is the cleanest thing I can think of. Good luck. DAS
Free Windows Admin Tool Kit Click here and download it now
March 4th, 2011 6:13pm

So to MSDN this is mote of a development problem than ITMy MVP is for the Windows Desktop Experience, i.e. Windows XP, Vista and Windows 7 IT I am best with C++ and I am learning C# using Visual Studio 2010 Developer | Windows IT | Chess | Economics | Hardcore Games | Vegan Advocate | PC Reviews
March 4th, 2011 6:55pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics