Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to run a *.bat file every time system returns/"wakes up" from hibernation (NOT a sleep mode). How can I do that?

System: Win XP SP3.
I would very strongly prefer to solve it without using 3rd party utilities.

Ideas?

share|improve this question

2 Answers 2

Set up a scheduled task in task scheduler and use an event as trigger(choose "When a specific event is logged"). In that, select following options:

  • Log: System
  • Source:Power-Troubleshooter
  • Event ID: 1

And then schedule whichever batch you wish to run. This should achieve your purpose. (I have tested this with Win 7 bcoz I don't have Win XP running. Should work with XP as well.)

share|improve this answer
    
There are no such settings in winxp task scheduler. –  SigTerm Apr 25 '12 at 7:17
    
Ok... well then try scheduling it for logon event and enable the setting for asking password on wake-up. –  tumchaaditya Apr 25 '12 at 9:16
    
Doesn't seem to work either. –  SigTerm Apr 26 '12 at 11:26
    
are you stubborn on not using any 3rd party tools? because, that seems to be the only way out.. or, you could upgrade to windows 7, which would be quite costly affair. –  tumchaaditya Apr 27 '12 at 3:57

I don't know if it's ok to answer after such a long time but the solution is to hibernate using a command inside the bat file followed by the commands you originally wanted to run. So when you Windows wakes up, it continues with the commands placed after the hibernate command. Here are some examples from Microsoft Community:

http://answers.microsoft.com/en-us/windows/forum/windows_xp-performance/how-to-activate-a-program-whenever-xp-wake-up-from/87636b33-d77f-4f38-8448-bf7f77f1417f

And my personal example for Win7 is:

mountvol E:\ /D
shutdown /H
mountvol E: \\?\Volume{f8916f50-b77b-11e0-b672-806e6f6e6963}

It unmounts the E drive before hibernate and remounts it when Windows wakes up (necessary for my dual boot).

Good luck!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.