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

zapp22

New member
Power User
VIP
Local time
4:29 PM
Messages
730
Location
Tejas, northern Mexico
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 Computer My Computer

At a glance

Windows XP Pro SP3, Windows 7 Pro 32-bit, Win...Pentium 4 3.2GHz, Pentium 4 3.4GHz 64bit, Atom,4GB matched, 1GB, 2.5GB, 4.0 GBGeforce 8400 GS and others
Computer Manufacturer/Model Number
HP DC7600, HP DC7600[2], HP DC7100, Samsung NC10
OS
Windows XP Pro SP3, Windows 7 Pro 32-bit, Windows 7 Ultimate 64bit, Windows XP Home SP3
CPU
Pentium 4 3.2GHz, Pentium 4 3.4GHz 64bit, Atom,
Motherboard
Dunno
Memory
4GB matched, 1GB, 2.5GB, 4.0 GB
Graphics Card(s)
Geforce 8400 GS and others
Sound Card
RealteK ALC260 and others
Monitor(s) Displays
Asus HD
Screen Resolution
1920x1080
Hard Drives
WD Caviar 640gb SATA
Cooling
We Be Cool
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 Computer My Computer

At a glance

Windows 7 Home Premium 64 BitIntel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz6.00 GB Hundai HMT125U6BFR8C-H9ATI Radeon HD 4850
Computer Manufacturer/Model Number
HP Pavilion e9110t
OS
Windows 7 Home Premium 64 Bit
CPU
Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz
Motherboard
Pegatron IPIEL-LA3
Memory
6.00 GB Hundai HMT125U6BFR8C-H9
Graphics Card(s)
ATI Radeon HD 4850
Sound Card
Realtek High Definition Audio/ATI High Definition Audio
Monitor(s) Displays
Acer AL2216W
Screen Resolution
1680x1050
Hard Drives
Hitachi HDP725050GLA360 ATA Device 500 GB
PSU
Unknown/installed by HP
Case
HP generic case
Cooling
Intel Stock Cooling
Keyboard
HP Keyboard
Mouse
HP Mouse
Internet Speed
Download: 19.15 Mbps Upload: 1.67 Mbps
Other Info
Network Adapter Realtek RTL8168D/8111D Family PCI-E Gigabit Ethernet NIC (NDIS 6.20)
Network Adapter 802.11n Wireless PCI Express Card LAN Adapter
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
 
Last edited:

My Computer My Computer

At a glance

Windows 7 Home Premium 64 BitIntel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz6.00 GB Hundai HMT125U6BFR8C-H9ATI Radeon HD 4850
Computer Manufacturer/Model Number
HP Pavilion e9110t
OS
Windows 7 Home Premium 64 Bit
CPU
Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz
Motherboard
Pegatron IPIEL-LA3
Memory
6.00 GB Hundai HMT125U6BFR8C-H9
Graphics Card(s)
ATI Radeon HD 4850
Sound Card
Realtek High Definition Audio/ATI High Definition Audio
Monitor(s) Displays
Acer AL2216W
Screen Resolution
1680x1050
Hard Drives
Hitachi HDP725050GLA360 ATA Device 500 GB
PSU
Unknown/installed by HP
Case
HP generic case
Cooling
Intel Stock Cooling
Keyboard
HP Keyboard
Mouse
HP Mouse
Internet Speed
Download: 19.15 Mbps Upload: 1.67 Mbps
Other Info
Network Adapter Realtek RTL8168D/8111D Family PCI-E Gigabit Ethernet NIC (NDIS 6.20)
Network Adapter 802.11n Wireless PCI Express Card LAN Adapter
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

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 Computer My Computer

At a glance

Windows XP Pro SP3, Windows 7 Pro 32-bit, Win...Pentium 4 3.2GHz, Pentium 4 3.4GHz 64bit, Atom,4GB matched, 1GB, 2.5GB, 4.0 GBGeforce 8400 GS and others
Computer Manufacturer/Model Number
HP DC7600, HP DC7600[2], HP DC7100, Samsung NC10
OS
Windows XP Pro SP3, Windows 7 Pro 32-bit, Windows 7 Ultimate 64bit, Windows XP Home SP3
CPU
Pentium 4 3.2GHz, Pentium 4 3.4GHz 64bit, Atom,
Motherboard
Dunno
Memory
4GB matched, 1GB, 2.5GB, 4.0 GB
Graphics Card(s)
Geforce 8400 GS and others
Sound Card
RealteK ALC260 and others
Monitor(s) Displays
Asus HD
Screen Resolution
1920x1080
Hard Drives
WD Caviar 640gb SATA
Cooling
We Be Cool
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 Computer My Computer

At a glance

Windows 7 Home Premium 64 BitIntel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz6.00 GB Hundai HMT125U6BFR8C-H9ATI Radeon HD 4850
Computer Manufacturer/Model Number
HP Pavilion e9110t
OS
Windows 7 Home Premium 64 Bit
CPU
Intel(R) Core(TM)2 Quad CPU Q9550 @ 2.83GHz
Motherboard
Pegatron IPIEL-LA3
Memory
6.00 GB Hundai HMT125U6BFR8C-H9
Graphics Card(s)
ATI Radeon HD 4850
Sound Card
Realtek High Definition Audio/ATI High Definition Audio
Monitor(s) Displays
Acer AL2216W
Screen Resolution
1680x1050
Hard Drives
Hitachi HDP725050GLA360 ATA Device 500 GB
PSU
Unknown/installed by HP
Case
HP generic case
Cooling
Intel Stock Cooling
Keyboard
HP Keyboard
Mouse
HP Mouse
Internet Speed
Download: 19.15 Mbps Upload: 1.67 Mbps
Other Info
Network Adapter Realtek RTL8168D/8111D Family PCI-E Gigabit Ethernet NIC (NDIS 6.20)
Network Adapter 802.11n Wireless PCI Express Card LAN Adapter
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 Computer My Computer

At a glance

Windows 10 Pro. EFI boot partition, full EFI ...i7 4770k 4.4GHz (44-44-43-43 turbo) @ 1.248V16GB (8GBx2) @2200 MHz G.skill Sniper 10-11-1...MSI GTX 970 Gaming 4G
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home built (GeneO industries)/Model 4
OS
Windows 10 Pro. EFI boot partition, full EFI boot
CPU
i7 4770k 4.4GHz (44-44-43-43 turbo) @ 1.248V
Motherboard
ASUS Maximus VI Hero
Memory
16GB (8GBx2) @2200 MHz G.skill Sniper 10-11-10-30-1, 1.6V
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Onboard SupremeFX Audio
Monitor(s) Displays
NEC Spectraview 2490WUXi-SV
Screen Resolution
1920 x 1200
Hard Drives
Samsung 850 Pro 256GB (OS), Samsung 2x 128GB 840 Pro SSD in RAID0, 3x WD Blue 6Gb/s 1TB RAID0, WD 2TB Black external USB 3.0, 2TB WD20EARS Green external USB 3.0, 2x 500GB Seagate and 1 750 GB external USB, 1x 350GB external USB3
PSU
Seasonic X-850 (2012 KM3 model)
Case
Fractal Design Define R4
Cooling
NH-D14, NF-F12, NF-A15; NF-P14, NF-P12,NF-A14, S12A PWM
Keyboard
Cooler Master Storm Quickfire Rapid - Brown
Mouse
Logitech G602
Internet Speed
126.4 Mb/s down, 24.3 Mb/s up
Other Info
USB 3.0 x8 , SATA III x8, eSATA, USB 2.0 x6. Samsung DVD R/W drive.

WEI: CPU 7.8, Memory 7.9, Graphics 7.9, Disk 7.9
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 Computer My Computer

At a glance

Windows 10 Pro (x64)Intel Core i7-3930K (3.2GHz - 4.5GHz)4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)Nvidia Geforce GTX 690
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Alienware Aurora ALX R4
OS
Windows 10 Pro (x64)
CPU
Intel Core i7-3930K (3.2GHz - 4.5GHz)
Motherboard
Alienware Aurora-R4 x79
Memory
4x Samsung 4GB PC3-12800 DDR3 (16GB 1600MHz)
Graphics Card(s)
Nvidia Geforce GTX 690
Sound Card
SteelSeries Siberia Elite
Monitor(s) Displays
Dell UltraSharp U3011
Screen Resolution
2560x1600
Hard Drives
Samsung 850 Pro 256 GB, Seagate 1TB Desktop Hybrid HDD, 2x Western Digital 4TB Green HDD
PSU
875W Some Dell PSU <.<
Case
Alienware Aurora ALX
Cooling
Custom Liquid Cooling (EK CPU & GPU blocks) dual EK 480RAD
Keyboard
Logitech G710+ Mechanical
Mouse
Logitech G700s
Internet Speed
Verizon Fios (50 mbps average)
Other Info
Server: Intel NUC D54250WYK: i5-4250U, 16GB, 256 GB mSATA, Windows Server 2012 R2
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.

:thumbsup:

Or hybrid sleep mode. Best of both worlds.
 

My Computer My Computer

At a glance

Windows 10 Pro. EFI boot partition, full EFI ...i7 4770k 4.4GHz (44-44-43-43 turbo) @ 1.248V16GB (8GBx2) @2200 MHz G.skill Sniper 10-11-1...MSI GTX 970 Gaming 4G
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Home built (GeneO industries)/Model 4
OS
Windows 10 Pro. EFI boot partition, full EFI boot
CPU
i7 4770k 4.4GHz (44-44-43-43 turbo) @ 1.248V
Motherboard
ASUS Maximus VI Hero
Memory
16GB (8GBx2) @2200 MHz G.skill Sniper 10-11-10-30-1, 1.6V
Graphics Card(s)
MSI GTX 970 Gaming 4G
Sound Card
Onboard SupremeFX Audio
Monitor(s) Displays
NEC Spectraview 2490WUXi-SV
Screen Resolution
1920 x 1200
Hard Drives
Samsung 850 Pro 256GB (OS), Samsung 2x 128GB 840 Pro SSD in RAID0, 3x WD Blue 6Gb/s 1TB RAID0, WD 2TB Black external USB 3.0, 2TB WD20EARS Green external USB 3.0, 2x 500GB Seagate and 1 750 GB external USB, 1x 350GB external USB3
PSU
Seasonic X-850 (2012 KM3 model)
Case
Fractal Design Define R4
Cooling
NH-D14, NF-F12, NF-A15; NF-P14, NF-P12,NF-A14, S12A PWM
Keyboard
Cooler Master Storm Quickfire Rapid - Brown
Mouse
Logitech G602
Internet Speed
126.4 Mb/s down, 24.3 Mb/s up
Other Info
USB 3.0 x8 , SATA III x8, eSATA, USB 2.0 x6. Samsung DVD R/W drive.

WEI: CPU 7.8, Memory 7.9, Graphics 7.9, Disk 7.9
Back
Top