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
zapp22

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 win7 controls, or is there an aftermarket, shareware, or scripting way to do so?

thx
z


My System SpecsSystem Spec
.
28 Dec 2011   #2
writhziden

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
writhziden

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
zapp22

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
writhziden

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
GeneO

Windows 10 Pro. EFI boot partition, full EFI boot
 
 

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
logicearth

Windows 10 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
GeneO

Windows 10 Pro. EFI boot partition, full EFI boot
 
 

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
Thread Forum
DRIVER_POWER_STATE_FAILURE when computer is idle for a period
Sometimes when I leave my computer on while I go do some other stuff I'll come back to see my computer is off and I had an BSOD. This is happening for a couple months now on and off, it only seems to happen if my computer is idle for to long and goes into sleep mode. According to the minidump and...
BSOD Help and Support
Random BSOD - Lenovo V570 laptop - power mgmt driver
Good morning, SF and BSOD teams: I've been suffering from random BSODs on my Lenovo V570 laptop running Win 7 Home Premium 64-bit on numerous occasions. This issue currently springs up at seemingly-random times, although there might be some correlation with me trying music-related activities...
BSOD Help and Support
Power option PCI express Link State Power Mgmt
Hello, I've done a lot of searches using variations of the above title and came up empty or just plain missed the answer. I'd like to know, if it is not asking too much, the following points: 1. What exactly is the function of Link State Power Management in the Power Options Advanced...
General Discussion
BSOD when idle for a long period of time.
Hi there, I normally leave my computer on overnight so I could do things such as defragging, virus scans and sometimes downloading. I'm running Windows 7 Ultimate x64, which I installed 3 days ago as I got a new hard drive. The system was blue screening since then, so I'm guessing it's not a...
BSOD Help and Support
BSOD after long period of shutdown on startup, random power shut off
Hi, this is my first time posting here in this forum because I am in desperate need of help on my computer. My computer gets at least ONCE BSOD every time I turn it on after a long period of shutdown. It also sometimes randomly just shuts off or give me additional BSODs. It has got to the point...
BSOD Help and Support
BSOD when leaving laptop idle for an extended period of time.
Everytime i leave my laptop idle for around 1-2+ hours it would BSOD and shut down. This problem started occuring about 2 weeks ago. The only time i get the BSOD is when i leave it idle, no other random BSOD. Please help me take a look and solve this persistent problem. Thanks for the assistance in...
BSOD Help and Support


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:43.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App