Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Power Mgmt: Is there a way to Shutdown after idle time period?


28 Dec 2011   #1

Windows XP Pro SP3, Windows 7 Pro 32-bit, Windows 7 Ultimate 64bit, Windows XP Home SP3
 
 
Power Mgmt: Is there a way to Shutdown after idle time period?

friends
I have a rig I use occasionally, as HTPC and occasional mule work, file service, etc.
I would like to not have it simply sleep when I have left it running and not returned, but rather have it shutdown properly.
Is there a way to do this within Windows 7 controls, or is there an aftermarket, shareware, or scripting way to do so?

thx
z


My System SpecsSystem Spec
.

28 Dec 2011   #2

Windows 7 Home Premium 64 Bit
 
 

Create a batch file and link to it with Windows Task Scheduler and have the scheduler run whenever the computer has been idle for xxxx seconds/minutes.

In the batch file:
shutdown /s /t 300

Shuts down the computer in five minutes forcing all applications to close. You can change it to less time if you want. 300 seconds is five minutes arbitrarily chosen.
My System SpecsSystem Spec
28 Dec 2011   #3

Windows 7 Home Premium 64 Bit
 
 

To create a batch file:
1. Click Start Menu
2. Click All Programs
3. Click Accessories
4. Click notepad
5. save as sd.bat (change "save as type: All Files") within the Users\myusername\Documents folder (myusername is your user name you login under)
6. Type shutdown /s /t 300 (or however many seconds you want greater than 0)
7. save the batch file.

Now we need to link to it using task scheduler:
1. Click Start Menu
2. Type "Task Scheduler" (without quotes) into the Search programs and files (do not hit enter)
3. Right click on Task Scheduler and select Run as administrator
4. Click Action -> Create Task...
5. Type name as sd.bat
6. Choose whether to run whether user is logged on (do not check the Do not store password box if you want the task to run when the user is not logged in)
7. Put tick next to Run with highest privileges (this setting may cause the task not to save, so uncheck if you have issues at the end of these steps)
8. Configure for Windows 7
9. Click the Triggers tab
10. Begin the task: On Idle
11. Make sure a check is in the Enabled box.
12. Hit OK
13. Click the Actions tab
14. Action: Start a Program
15. Browse for sd.bat
16. Click OK
17. Click the Conditions tab
18. Start the Task if the computer is idle for (However long you want to wait for it to shutdown without a user using the computer).
19. Wait for idle for: Do not wait
20. Stop if the computer ceases to be idle (if you want the user to have a chance to stop the shutdown).
21. Set up the power settings as you would like
22. Click the Settings tab
23. Set the settings to your liking. (If you have questions, just ask)
24. Hit OK
My System SpecsSystem Spec
.


28 Dec 2011   #4

Windows XP Pro SP3, Windows 7 Pro 32-bit, Windows 7 Ultimate 64bit, Windows XP Home SP3
 
 

terrific;
I'll give it a shot writh.
gracias
[ps on that failed HDD - I haven't given up. will be posting back an update]
z

Quote   Quote: Originally Posted by writhziden View Post
Create a batch file and link to it with Windows Task Scheduler and have the scheduler run whenever the computer has been idle for xxxx seconds/minutes.

In the batch file:
shutdown /s /t 300

Shuts down the computer in five minutes forcing all applications to close. You can change it to less time if you want. 300 seconds is five minutes arbitrarily chosen.
My System SpecsSystem Spec
28 Dec 2011   #5

Windows 7 Home Premium 64 Bit
 
 

Change step 10 as follows:

10. Begin the task: On Idle -> Begin the task: At system startup.

Delay task for 15 minutes.

Have it repeat the task every 15 minutes for a duration of indefinitely (in case the user stops the task).
My System SpecsSystem Spec
29 Dec 2011   #6

Windows 7 64 bit SP1
 
 

Or I believe you can use the task scheduler to run the script when it receieves a kernel-power event, Event ID 42 (system is entering sleep state)

Schedule, on an event, Log: system, source: Kernel-Power, Event ID: 42.

I think it should work without complications.
My System SpecsSystem Spec
29 Dec 2011   #7

Windows 8.1 Pro (x64)
 
 

Why not just have the computer go into hibernation? No need for task scheduler or batch scripts that way. And you don't run the risk of shutting down when you should not. Hibernation fully shutdown the computer, it just happens to save the current state on the HDD before it does.
My System SpecsSystem Spec
30 Dec 2011   #8

Windows 7 64 bit SP1
 
 

Quote   Quote: Originally Posted by logicearth View Post
Why not just have the computer go into hibernation? No need for task scheduler or batch scripts that way. And you don't run the risk of shutting down when you should not. Hibernation fully shutdown the computer, it just happens to save the current state on the HDD before it does.


Or hybrid sleep mode. Best of both worlds.
My System SpecsSystem Spec
Reply

 Power Mgmt: Is there a way to Shutdown after idle time period?




Thread Tools



Similar help and support threads for2: Power Mgmt: Is there a way to Shutdown after idle time period?
Thread Forum
Why won't my hard drives spin down after idle period? Hardware & Devices
Random BSOD - Lenovo V570 laptop - power mgmt driver BSOD Help and Support
Power option PCI express Link State Power Mgmt General Discussion
BSOD when idle for a long period of time. BSOD Help and Support
BSOD after long period of shutdown on startup, random power shut off BSOD Help and Support
BSOD when leaving laptop idle for an extended period of time. BSOD Help and Support
How to turn off one monitor seperately using Power Mgmt? Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:38 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33