- Home
- Windows Vista
- Customize
- Windows Vista Shutdown.exe - Maximum allowed timeout value is 600 Seconds
- Home
- Windows Vista
- Scripts
- Windows Vista Shutdown.exe - Maximum allowed timeout value is 600 Seconds
Windows Vista Shutdown.exe - Maximum allowed timeout value is 600 Seconds
Problem
I used to schedule system shutdown using the command prompt and desktop shortcuts on my old XP SP2 machine: (For example shutdown.exe /s /t 1200). When I try to do this from the command prompt in Vista, I get the shutdown.exe help text displaying after the prompt - almost as if it is ignoring the switches.
Workaround
In Windows XP, there is no upper limit on the timeout value for shutdown.exe tool. Whereas in Windows Vista, the maximum timeout value accepted is 600 seconds (that is, 10 minutes). So, to configure the machine to shutdown in 2 or 3 hours from the current time, you may need to use shutdown.exe in a script or a batch file. You may use my script below:
'Launches "shutdown.exe /s /t xxx" - This script is a workaround...
'... for the 600 seconds time-out limit in Vista.
'Created on March 30, 2007
'Copyright © 2007 Ramesh Srinivasan.
'Winhelponline.com - http://www.winhelponline.com
Set objShell = CreateObject("Wscript.Shell")
strMsg = "Enter the shutdown timeout period (in Seconds)"
iSec = trim(InputBox (strMsg,"Shutdown timeout value",750))
if iSec = "" then wscript.quit
if iSec > 600 then
iSleep = int(iSec) - 600
iSleep = iSleep * 1000
WScript.Sleep iSleep
objShell.Run "shutdown.exe /s /t 600"
else
objShell.Run "shutdown.exe /s /t " & iSec
end If
Copy the above code to Notepad and save the file with .vbs extension (say, turnoff.vbs). To initiate a shutdown, double-click the script and enter the timeout value in Seconds.
The script works this way: If the timeout value entered by the user exceeds 600 seconds, the script sleeps for the exceeded value (i.e., <Timeout value> - 600 Seconds) and then invokes Shutdown.exe passing 600 (seconds) as the timeout value.
Note that you can accomplish the same using the sleep.exe tool from the Windows Resource Kit Tools, and using them in a Batch file.
If you enjoyed this post, make sure you
subscribe to our RSS feed!
We feature Tips, Troubleshooting information, Scripts and Utilities for Microsoft Windows Operating Systems!
Prefer an E-mail subscription?
6 Responses to "Windows Vista Shutdown.exe - Maximum allowed timeout value is 600 Seconds" 
|
said this on 13 Apr 2007 3:27:16 PM PST
What is wrong with using PING command :
cmd /c ping localhost -n 9999 & shutdown.exe /s /t 0
Editor's note: Although PING would do the task, IMO, using sleep.exe or Sleep method in a script is more elegant. No other additional windows are opened, and no additional CPU time is used.
|
|
said this on 06 May 2007 1:27:08 PM PST
Thank you very much for making this. I usually do alot of video conversions and I like to do it when I'm out but don't want my computer running longer than it should (room gets crazy hot). I was having issues with shutdowns that needed to happen hours later. Thank You very much!
|
|
said this on 27 May 2007 5:08:32 PM PST
you can swap the shutdown.exe form xp with the one from vista. It works perfectly and alows the time to be as long as you want
|
|
said this on 17 Apr 2008 5:33:46 AM PST
If you are using Vista x64 (probably x86 too), and have upgraded to SP1 - this script will no longer work. You will need to copy shutdown.exe from an XP machine to C:\Windows\System32 (x86 and x64) & C:\Windows\SysWOW64 (x64 only).
- Yes, you need to replace both copies in Vista x64.
NOTE: In vista, before you can overwrite system files, you must first take ownership of the file, then grant your self full permissions to it. This is done under the 'Security' tab in the file properties.
If you still want to be able to use a vbs script, after replacing shutdown.exe with the XP version, rather than typing the command, use the following:
'Winhelponline.com - http://www.winhelponline.com
Set objShell = CreateObject("Wscript.Shell")
strMsg = "Enter the shutdown timeout period (in Seconds)"
iSec = trim(InputBox (strMsg,"Shutdown timeout value",750))
if iSec = "" then
wscript.quit
else
objShell.Run "shutdown.exe /s /t "' & iSec
end if
|
|
said this on 29 Jul 2008 9:33:05 PM PST
try the 'timeout' command in a batch file.
timeout /t
|

Author)