Create a script to put Windows 7 to sleep

d0b33

Honorary Master
Joined
Jul 16, 2004
Messages
17,506
Reaction score
493
Location
Western Cape
I would like to use task scheduler to run a script each day putting my PC to sleep, any help would be appreciated.
 
Erm, what's wrong with the way the normal Power schemes work?
 
on your clear desktop :
1. Rightclick, select Personalize
2. Click Screensaver tab at the bottom right of that window
3. Click "Change Power Settings" at the bottom of the screensaver window
4. Where Balanced is selected, to the right click Change Plan Settings


there ya go - happy tweaking!, otherwise you can go tweaking in the "Change Advanced power settings" section just below those two boxes.

Good luck!
 
I run a program (TV) that prevents sleep so I need a script to force sleep.
 
I'd imagine put this in a .bat file and have scheduler run the bat. ( minues the < > )
taskkill /im <tvprogram.exe>

Edit: you may also want to use the /t switch ( kill child processes )
 
Last edited:
The following will put your pc to sleep:

rundll32 powrprof.dll,SetSuspendState
 
Top
Sign up to the MyBroadband newsletter
X