Hi everyone I have been trying to get various computers with Windows 10 to auto shutdown when idle after a preset time. So far with no success. Do not want sleep or hibernate full shutdown required I have set up tasks in task scheduler ( does not work ) double checked settings are ok . I have tried several 3rd part apps and apart from 1 paid for application on trial nothing seems to work that is free ? I suspect its all to do with the computers on windows 10 are not ever actually running idle so the process does not kick in hence no shutdown. Just wondered has anybody out in MDL found a working free method to achieve this operation ? many thanks for any replies
The story you said is strange in many ways. If your computer has such problems, there are only two options: - There is something wrong with your computer, ie it may have damaged systems or settings or the settings are wrong. - but if you claim that the sheduled task also does not work, it could also be a mistake that this task was set incorrectly. If you want more detailed information, you first need to say what kind of computer it is, whether it is a desktop computer or laptop, or something else. It would also be interesting to know what you have tried and how. Also would ask for the script or commands you used to configure the sheduled task. Among other things, you haven't said why you are not using or, if you are using it, how do you use Windows Power Options, how have you set up Advanced Power Options?
ok this is fantastic news I assumed the tutorial I followed would be good clearly you have seen faults with it I have not used a script ? just task scheduler as set up in the tutorial Can you help me with steps to correct it so it will work correctly ?
1. Tell, what You write instead of word "shutdown" - on picture in red box. 2. what is the time when Your computer logs off users if idle?
shutdown.exe will do nothing without command line argument, ie s, r, l etc. open it with cmd.exe and they are all there C:\WINDOWS\system32>shutdown.exe Usage: shutdown.exe [/i | /l | /s | /sg | /r | /g | /a | /p | /h | /e | /o] [/hybrid] [/soft] [/fw] [/f] [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] if You want only shut down computer, You must use this Code: %SystemRoot%\System32\shutdown.exe /f /s /t 00 if You have W10x86 %SystemRoot%\SysWOW64\shutdown.exe /f /s /t 00 if You have W10x64
Enter this in a cmd/powershell/win+r.. Code: powershell -c "start schtasks -arg ('/Create /RU System /NP /RL HIGHEST /F /TN ShutdownOnIdle /V1 /SC ONIDLE /I 1 /TR '+[char]34+'cmd /c timeout /T 900 && shutdown /s /hybrid /t 0 /d p:0:0'+[char]34) -verb runas" Triggers after 15 minutes of pc being idle (change the Interval parameter /I 15 to whatever time you need - must be in minutes, minimum of 1) <update: Change the idle duration after the timeout /T parameter - above set to 900 = 15 minutes x 60 seconds. - Idle detection happens every 10(5?) minutes by default if no screen saver / turn off monitor is set, so keep that in mind (substract it from the number of seconds you're gonna use for /T - for example if the display is set to power off after 2 minutes idle, then to shutdown at precisely 15 minutes you would use (15-2) x 60 = 780). Also added the planned parameter to the shutdown command so that it generates an information event log instead of an error. I have tested this workaround on Pro v1903 and it works as expected: as soon as PC enters idle mode, cmd starts counting down then shuts down. If interrupting the idle mode before the count down finishes, shutdown is aborted. I see no reason why it would not work on all Windows 10 versions. :update> Took liberty to add /hybrid parameter since it does help speed up cold boots on uefi afterwards. Rather strange request, since this will discard any unsaved work across all logged on accounts!
Hi thanks for this powershell -c "start schtasks -arg ('/Create /RU System /NP /RL HIGHEST /F /TN ShutdownOnIdle /SC ONIDLE /I 15 /TR '+[char]34+'shutdown /s /hybrid /t 0'+[char]34) -verb runas" if I ever wanted to remove it completely in the future what command would then be required ? regards
Code: powershell -c "start schtasks -arg '/Delete /F /TN ShutdownOnIdle' -verb runas" Task being set to run for system account means it will absolutely run and be able to force shutdown the PC on idle. But some PCs might never enter idle mode due to various reasons such as downloading / seeding torrents, media players running, other users logged on via network, windows updates/telemetry/maintenance hanging, shutdown.exe tool missing (deleted/blocked), or even optical mouse or other controllers placed incorrectly or natively "drifting" (for that there are solutions such as disabling wake up in mouse power options and deploying a screensaver that ignores small mouse movements).
ok we have made progress at last we get a shutdown after using the script in powershell will continue testing and changing the shutdown times many thanks will report back !!
update well shutdown now always works ! but strangely no matter whatever I set the shutdown time to it always shuts down after 10mins ?? I have looked in the settings within task scheduler and say I have set the time for 30 mins using the powershell script the time is set correctly for 30mins in task scheduler but the computer ignores this and shuts down everytime after only 10 mins ?? where am I going wrong ??