Help with scheduled task

GrantMeThePower

Platinum Member
Jun 10, 2005
2,923
2
0
I'm running MCE 05 (essentially pro w/o domain networking and a nifty app). I can not get my scheduled task to shutdown the computer to work. THe auto on is fine and I have that set in the BIOS, but for some reason it won't shutdown on its own. I created a new shceduled task and set it to run daily at the appinted time, but nothing happens. Does anyone know how to get this to work right?

Thanks!
 

mikecel79

Platinum Member
Jan 15, 2002
2,858
1
81
What is the command line you are using to shut the machine down in the Scheduled Task?
 

GrantMeThePower

Platinum Member
Jun 10, 2005
2,923
2
0
In the %SystemRoot%\System32 folder, i simply selected the Shutdown.exe file and selected the daily frequency. Is that not right?
 

MixMasterTang

Diamond Member
Jul 23, 2001
3,167
176
106
shutdown.exe -S - F

Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "c
omment"] [-d up:xx:yy]

No args Display this message (same as -?)
-i Display GUI interface, must be the first option
-l Log off (cannot be used with -m option)
-s Shutdown the computer
-r Shutdown and restart the computer
-a Abort a system shutdown
-m \\computername Remote computer to shutdown/restart/abort
-t xx Set timeout for shutdown to xx seconds
-c "comment" Shutdown comment (maximum of 127 characters)
-f Forces running applications to close without war
ning
-d [p]:xx:yy The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer le
ss than 256)
yy is the minor reason code (positive integer le
ss than 65536)
 

MadRat

Lifer
Oct 14, 1999
12,011
320
126
XP includes the shutdown.exe, but older versions of Windows I don't think do. Or you can grab a better copy from the Windows 2003 Resource Kit.
 

jfunk

Golden Member
Oct 16, 2000
1,208
0
76
Does shutdown work if you run it manually?

If so, try creating a bat file that calls it and schedule that instead.

 

GrantMeThePower

Platinum Member
Jun 10, 2005
2,923
2
0
Originally posted by: jfunk
Does shutdown work if you run it manually?

If so, try creating a bat file that calls it and schedule that instead.

Yes, shutdown works normally (by normally, i mean going to the start menu, selecting shutdown and then clicking shutdown again on the following popup menu).

What does a bat file do? (i know i lack quite a bit of knowledge, but thats what i'm doing is learning!) Thank you!!!
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
if you open a command window and type "shutdown.exe" does it work (answer will be no)

you have to pass parameters to the shutdown command, as noted above. So start notepad, type the full command "shutdown -s -f" and do a "save as" and save it somewhere as "shutdown.bat"

now go schedule the shutdown.bat file to run at X:XX time.
 

GrantMeThePower

Platinum Member
Jun 10, 2005
2,923
2
0
Originally posted by: nweaver
if you open a command window and type "shutdown.exe" does it work (answer will be no)

you have to pass parameters to the shutdown command, as noted above. So start notepad, type the full command "shutdown -s -f" and do a "save as" and save it somewhere as "shutdown.bat"

now go schedule the shutdown.bat file to run at X:XX time.

Excellent! Thank you thank you for the explaination. I'll try it as soon as i get home tonight!!!!
 

MadRat

Lifer
Oct 14, 1999
12,011
320
126
You may have to run that bat file as an administrator. Seems like MS changed shutdown.exe to not work via scripts except with admin accounts. You should be able to set parameters for a commandline in your task scheduler without using a bat file, too. However you want it to run is how you set the commandline in your task. The reason I suggest a better copy from the Windows 2003 Resource Kit is because it supported a more granular set of switches.