Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.


share|improve this question

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:

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


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.