• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 915
  • Last Modified:

Running/ Creating a batch file to run Shutdown.exe command

I want to schedule 3 servers on my network to reboot every monday @ 130 am.  

shutdown \\computer1 /r at 13:30 /every:M

Is this syntax correct?  How can i store this in a batch file to be called every monday?

Thank you
0
QDS
Asked:
QDS
  • 2
  • 2
  • 2
  • +3
1 Solution
 
McKnifeCommented:
use shutdown -r -f \\computer
and put it into a batch. Let it be executed through scheduler at the appropriate times and use multiple schedules.
It has to be executed through an account that has admin rights remotely.
0
 
centrepcCommented:
http://support.microsoft.com/?kbid=317371 is link to read up on the correct syntax

The easiest way to complete this is to create a .bat file and use the scheduled task to run the job automatically

shutdown \\computer1 /r

is the only text you need in the bat file.  

to create a .bat file open notepad enter the command and save as weekly_reboot.bat

Then schedule weekly_reboot.bat to run every monday at 1:30am

Your 13:30 would reboot the server every monday in the middle of the day......

0
 
QDSAuthor Commented:
Thank you for your quick response.  This in on Win2k machines.  What is -f stand for?  Would my computer have be to be logged into, logged out and/ or locked to performed this??
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
QDSAuthor Commented:
Also what would happen in in this case if there happened to be a program running?  would these commands work?
0
 
centrepcCommented:
/c and /y will take care of any programs running without stopping at any prompts.

I am not sure what the -f mentioned above does.  I never have had to use that.  

usually

shutdown \\computername /r /c /y will take care of it...
0
 
McKnifeCommented:
They work no matter if locked or if no one is logged on.
f forcces applications to shut down.

But both of us forgot -m,  the correct syntax would be
use shutdown -r -f -m \\computer
0
 
dcp002Commented:
An alternative:   On each server set-up a scheduled task with this line:

tsshutdn /reboot

Task schduler = Start - Settings - Control Panel - Scheduled tasks.

more details on tsshutdn at http://support.microsoft.com/?kbid=320188


0
 
r-kCommented:
I would recommend scheduling the bat file with the AT command, not the GUI interface of the Control Panel.

See http://support.microsoft.com/default.aspx?scid=kb;en-us;313565&sd=tech for a description of the AT command.
0
 
paraghsCommented:
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
  • 2
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now