Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

shutdown shedule in a batch file

Status
Not open for further replies.

sh0re

IS-IT--Management
Dec 6, 2002
13
0
0
PT
Hi,

I'm trying to schedule a shutdown with a batch file and task scheduler. The problem is the command (shutdown -s -f) runs wiht no problems on the command line, but not in the batch file. It keeps repeating the command, but wiht no results.

Thanks
 
Rather than running it in a batchfile, have you tried running the command directly from the scheduler? Either as shutdown -s -f or c:\winnt\system32\shutdown.exe -s -f
 
Hmm, tried that last night, using shutdown /h /f, didn't work, but after a bit of checking found out hibernation does not work when ras is enabled, bugger!

Will try again tonight with a scheduled reboot.
 
It doesn't work either.. and hibernation is turned off. The batch didn'd work even when ran directly. It does now, but only with the CALL command before the shutdown -s -f, but not when scheduled.
 
only thing I can think of now is to call a script from the schedule to open the command prompt and 'type' the command in as if you were typing it yourself. That should work, although I have not had time to try this myself, and I'll be aay from the computer for a while.

May be worth a try though.
 
it worked with me :

shut.bat
shutdown -m \\pentiumiv -a


no problem in batch or to run the batch in shedular... in shedelur i had to give an username en password to run the batch file. Administrator login + pass and it's ok.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top