Live Chat & Podcast at 1:00PM Eastern on Sunday!

Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Windows 7 Windows 7
Search Search
Search for:
Tech Support Guy Forums > > >

Run scheduled task or GPO when Win7 SleepMode is triggered?


(!)

decz's Avatar
Computer Specs
Member with 95 posts.
THREAD STARTER
 
Join Date: Apr 2009
Location: PA
Experience: Advanced
09-Jul-2012, 03:16 PM #1
Question Run scheduled task or GPO when Win7 SleepMode is triggered?
Hello all, I'd like to launch a custom batch file when my computer goes into sleep mode. I would like to launch this batch through a GPO or task scheduler.

I've tested using task scheduler and the power event ID for sleep mode but it seems the event triggers too late for the application to run and the computer just continues into sleep mode.
I could create a scheduled task to trigger a minute before the idle time-out for sleep mode but this doesn't help if I actively put the computer into sleep mode.

Does anyone know of a way to do this?
decz's Avatar
Computer Specs
Member with 95 posts.
THREAD STARTER
 
Join Date: Apr 2009
Location: PA
Experience: Advanced
12-Jul-2012, 09:48 AM #2
Okay through testing I've discovered that using the event id for sleep-mode won't work because it is triggered too late for task scheduler, in fact task scheduler will read the event id after waking up and then trigger.

I was able to get task scheduler to trigger before sleep-mode based on idle timeout but this doesn't help when a user actively enters sleep-mode.

Going to check around on technet and try some experimenting.
leroys1000's Avatar
Account Disabled with 6,319 posts.
 
Join Date: Aug 2007
Location: Boise,Idaho
Experience: Intermediate
12-Jul-2012, 12:27 PM #3
Go into task scheduler and check the properties on that task.
There should be a selection "wake the computer to run this task".
Check the conditions tab.
decz's Avatar
Computer Specs
Member with 95 posts.
THREAD STARTER
 
Join Date: Apr 2009
Location: PA
Experience: Advanced
12-Jul-2012, 02:06 PM #4
Quote:
Originally Posted by leroys1000 View Post
Go into task scheduler and check the properties on that task.
There should be a selection "wake the computer to run this task".
Check the conditions tab.
Thanks for the reply loreys. However, I want the task to execute before the computer actually goes into sleep-mode. Similar to launching a task at shutdown.
leroys1000's Avatar
Account Disabled with 6,319 posts.
 
Join Date: Aug 2007
Location: Boise,Idaho
Experience: Intermediate
12-Jul-2012, 07:28 PM #5
Don't know if this would help or not.
You might be able to use MCE standby tool to set a delay
for standby to give it time to execute the batch file.
http://slicksolutions.eu/mst.shtml
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑