I have a buggy driver for my Wifi USB dongle. Every time the computer wakes from standby, the wifi is disabled.

I created a script to restart the device, but I have no idea how to automatically run it when wake from standby.

I'm using Windows 7 x64.

3 Answers 3


Here is a link to a script that monitors the event log. Check the log for what the message is for waking up from standby and you should be good to go.


This free utility might help : WakeupOnStandBy

Can run a file or open a web page at a predetermined time after a wake-up event, during normal operation, or before performing power operation;

(Note: I have no experience with this utility)

  • This doesn't quite work. It requires a time to automatically wake up.
    – gak
    Oct 11, 2012 at 7:59
  • @GeraldKaszuba I can see in the screenshot the option "perform these tasks if computer wakes up earlier", would that do what you're after? There's some more details here. It says "If you want to perform scheduled tasks even if computer wakes up earlier than the time specified in item (1), check the appropriate box underneath the date & time control. If checked, this option will first perform all the checked options in item (1), then run a file in the item (2) and trigger additional operations in items (3) and (4)."
    – eis
    Oct 11, 2012 at 10:32
  • @eis It still requires you do specify a time. I suppose if you set the date to the far future, it will not automatically awake.
    – gak
    Oct 11, 2012 at 21:47
  • @GeraldKaszuba yeah, since it seems to include a year also, you could set it to 2099 or something
    – eis
    Oct 12, 2012 at 5:19

There's a possible solution here: Run script on resume from standby: post #4

If you can put your machine into standby mode via a shortcut then then all you need to do is get it to run this batch file:

@echo off
Rundll32.exe PowrProf.dll,SetSuspendState
ping localhost -n 3 > nul
[your code goes here]

(ping is used because Windows lacks a sleep command)


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .