Question Locked

Automatic Shutdown Script Issue

0 helpful
11 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hey all, I am trying to get my systems on my SMB network to shutdown at a specific time of day, that way windows scheduler can run some tasks after hours then shut down when complete. Currently, I have this script running as a .bat file. It is
shutdown -f -s -t 600 -c "This system is shutting down for the night, please save any work at this time."
Unfortunatly it just isn't working and I don't know why. I am running this script on XP Pro and Vista systems. Any help here would be great. Thanks.

11 replies

by larryd4

I have my shutdown\restart on my servers scheduled with the command line itself.

The run line for the scheduled weekly restart task is
c:\WINDOWS\system32\shutdown.exe /r

Try putting the command line directly in the run line of the scheduled task. No need for the batch file.

by wizard-09

You need to tell the computer what time to run the bat file you need to schedule a task to run the file.

or you can use the -r to remotely shutdown the computer in question.

by larryd4

Their is no need for a batch file you can run the shutdown command directly from the scheduled task interface.

by wizard-09

I just like to use bat files, either way it still does the same job plus if you want to tell users the machine is going to shut down its better to use a bat file

by larryd4

I understand that in some ways a batch file works and its a choice. But he's using the scheduler to run the batch file and its failing. He's not creating the scheduled task with a command in the batch file.

by wizard-09

Maybe check the event log for any errors, also maybe use the run as command and run under admin if this have not already been done maybe the current users does not have the rights to run a task?

Just a thought

by Former member

by rockinmycountry

Well, I went ahead and abandoned the script, there were just too many problems with it. I have it set up now that when all the programs finish for the night it will shutdown automatically and it work. Thanks all for the replies, most helpful.

by Former member

Please post back if you have any more problems or questions.
If this information is useful, please mark as helpful. Thanks.

by bartvannoppen

I've found using shutdown / instead of - works on XP.
Also, to create a scheduled task you can use the AT command.

This discussion is closed to new replies.