Does anyone know how to set something like a batch file to run when a computer resumes from standby/hibernate?
Does anyone know how to set something like a batch file to run when a computer resumes from standby/hibernate?
Run programs on hibernate/suspend and resume! - MP3Car.com
?
I dont recall a DOS/Batch command to have things run on wake (startup yes), and the Scheduled Tasks only has things for go on idle, startup, etc, so this may be the best you get.
I saw that thread when I searched "run on resume" in google, the link is dead and I'm not sure how much I'd trust a 3rd party program.
There's more talk of it on linux than for windows, I'm not sure why. Maybe people on windows just dont like to automate things.
Well... maybe we can go about it a different way.
The reason I want to run a batch file is that if I put my laptop into standby for too long it loses network connectivity, I'm not really sure what was wrong specifically I was too lazy to troubleshoot it that far, I just created a batch file that pretty much restarts all network connections. If anyone knows why that happens or how I can fix that it'd be a more direct solution to this.
Code:ipconfig /renew arp -d * nbtstat -R nbtstat -RR ipconfig /flushdns ipconfig /registerdns
I googled the name of the file that was refered to in the dead link and found this Hibernate Trigger
Seems harmless.
And standby/hibernate has been know to do that, but check your power settings and look to see if youre not telling them it to disconnect.
You could just stop using hibernate/standby?
Yeah, it does suck ass.
Why? You may just want to leave it on, as you'll not save a whole lot of energy. There's not really any advantage to leaving it in hibernate mode, especially if you have to fiddle around with something when you restart it -- you may as well have turned off the computer and be waiting for it to boot up again, then. Any applications you left running could crash or otherwise produce errors upon resume, too.
Of course, that doesn't answer your initial question, but I'm unaware of any way to run scripts upon resume. Although things can be programmed which send Windows into hibernation under certain circumstances, because of the nature of how hibernation works (saving your state and restoring an identical version of it upon resume).
That doesn't mean such a thing doesn't exist, but it doesn't sound likely to me. I'd suppose an application would have to be programmed which sensed Windows waking up and restoring the state from your RAM/HDD and then run itself, if that were possible.
Ghetto solution: turn on speed-step bullshit to save power when idle, use blank black screensaver
If there's a specific reason that he doesn't want it to turn off... like... this:
Faronics - Home of Deep Freeze and other Intelligent Solutions for ABSOLUTE Control
Using hibernate would make sense... other than that I'd just turn it off.
As far as your problem with your net being disabled, like others above posted, check your power settings and make sure that it isn't set to disable ethernet ports or your wireless card (whichever you use) when it goes into standby/hibernate.
Firstly, I don't know what that link even is, but thanks for the thought.
I didn't really want to reply to the power settings thing because well... I'd rather not say since you're just trying to help.
They're not disabled. It feels more like something forgot I'm connected. Everything is enabled, everything is properly configured, but somewhere along the way it feels like someone forgot they were talking to someone else.
The most interesting notion I've read, courtesy of some serious Googling, is electromagnetic interference caused by the components in the laptop lid interacting with the main internals. Unfortunately, there's no solution for that.
I don't really have any suggestions. Good luck finding a solution, but I'd recommend just not using hibernate mode.
Just annoying me, it's essentially the same thing as far as pausing network interactions but it's standby not hibernate that I'm using.
Well, you said standby/hibernate in your original post, damn you!
Anyway, like you said, they're not much different. Hibernate uses the HDD, Standby uses your RAM. I don't know of a solution myself, but I did a little digging regarding Windows' functions when it awakens, and found out that there is a WMI class that notices this occurrence. It's Win32_PowerManagementEvent.
So, here's the info from the MSDN page I found it on:
The other information in the post is useless, as it points to links which are now broken. If you don't want to use that or the program mentioned previously in this thread -- I'd suppose it probably uses the same event trigger -- you could always get Seno to be your bitch.Originally Posted by MSDN
Chances are very good you can make this work with the task scheduler.
Right Click My Computer -> Manage -> Task Scheduler. You need to find a log event that happens when your computer wakes up from hibernate and have the task scheduler watch for that, theres probably an associated System -> ACPI message that gets fired when your computer wakes up. To view log events to look for something to hook on to flip to the event viewer just below the task scheduler, then go to windows logs, and look through them for an event that you know occurs on wake from hibernate.