Restarting server with bat file

1

I'm trying to make a simple bat file that restarts a server. It looks like this:

shutdown -r -f -t 60

But all it does is loop inside the cmd window, printing the command > new line > priting the command. Over and over.

Control + Alt + Delete only opens up the menu on the machine where I RDP in from and not on the server itself.

Jason94

Posted 2011-09-20T08:11:05.003

Reputation: 1 125

What is the .bat file called? It's not shutdown.bat, is it? Also, Ctrl-Alt-End is the Ctrl-Alt-Delete in a RDP session. – tombull89 – 2011-09-20T08:19:13.377

@tombull89 atrl-alt-end, got it. thanks! – Jason94 – 2011-09-20T08:43:22.667

Answers

5

Is your batch file called shutdown.bat? If so, the script won't call system restart, the name causes the script to loop.

Try to rename your batch file to something else, or, as a good geek, move to PowerShell. If you decide to switch, you'll need the Restart-Computer command.

Steve B

Posted 2011-09-20T08:11:05.003

Reputation: 1 580

1Or be explicit: shutdown.EXE -r -f -t 60 – MSalters – 2011-09-20T12:37:20.870