Link to home
Start Free TrialLog in
Avatar of QDS
QDS

asked on

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
Avatar of McKnife
McKnife
Flag of Germany image

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.
ASKER CERTIFIED SOLUTION
Avatar of centrepc
centrepc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of QDS
QDS

ASKER

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??
Avatar of QDS

ASKER

Also what would happen in in this case if there happened to be a program running?  would these commands work?
/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...
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
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


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.