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 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 Widnows 7 x64.

share|improve this question

3 Answers 3

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)

share|improve this answer
    
    
It's a good solution, but only if you're making the computer go to sleep manually. –  Gerald Kaszuba Oct 11 '12 at 8:00

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.

share|improve this answer

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)

share|improve this answer
    
This doesn't quite work. It requires a time to automatically wake up. –  Gerald Kaszuba Oct 11 '12 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 '12 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. –  Gerald Kaszuba Oct 11 '12 at 21:47
    
@GeraldKaszuba yeah, since it seems to include a year also, you could set it to 2099 or something –  eis Oct 12 '12 at 5:19

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.