PC Review Forums Newsgroups Windows Vista Windows Vista General Discussion Shutdonw /t 600 limit

Reply

Shutdonw /t 600 limit

 
Thread Tools Rate Thread
Old 02-10-2007, 09:25 PM   #1
Bildos
Guest
 
Posts: n/a
Default Shutdonw /t 600 limit


Hello,

How can I schedule shutdown my Vista with time more than 600 second ?

In XP there wasn't problem. In vista SHUTDOWN.exe /t is limited to 600
second
Any ideas ?


Redgards
Bildos

  Reply With Quote
Old 03-10-2007, 06:11 AM   #2
Andrew McLaren
Guest
 
Posts: n/a
Default Re: Shutdonw /t 600 limit

"Bildos" <bildos@gmail.com> wrote ...
> How can I schedule shutdown my Vista with time more than 600 second ?


Hi Bildos

Two possible approaches:

1) run shutdown.exe as a scheduled task. Use the "schtasks" command to
create the task from the command line:

C:\>schtasks /create /tn "My Long Shutdown" /tr
"C:\Windows\System32\shutdown.exe /s /f" /sc once /sd 03/10/2007 /st 16:02
/F /Z

.... will run shutdown.exe at 16:02 on 02 October 2007 (schtasks uses the
time and date formats for your configured region. For example, if you were
configured for the US, you would write 10/03/2007 instead). You can leave
out the "/sd 03/10/2007" parameter, and schtasks will default to the current
date:

C:\>schtasks /create /tn "My Long Shutdown" /tr
"C:\Windows\System32\shutdown.exe /s /f" /sc once /st 16:02 /F /Z

Put the command line in a batch file, to make it easier to run on a regular
basis:

C:\>MyShutdn.cmd 16:02

The main downside to this approach is the shutdown time is specified as an
absolute time (eg, 16:02) not a time relative to now (eg, in 700 seconds).


2) Call the WMI Win32Shutdown method in a VBScript. This method will
shutdown the computer immediately. But it will be trivial to add a couple of
lines to the script, to wait until the desired time, before calling the
method.

You'll find a description of Win32Shutdown here:
http://msdn2.microsoft.com/en-us/library/aa394058.aspx

and a sample script to shutdown immediately, here:
http://msdn2.microsoft.com/en-us/library/aa394591.aspx

Modifying this script to wait a certain number of seconds before calling
Win32Shutdown , is left as an exercise for the reader :-) But it should be
easy.


There are probably several other techniques as well. Hope it helps,
--
Andrew McLaren
amclar (at) optusnet dot com dot au


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off