Okay, I'm using VI and this is the first script I've ever run. I can get the script to run and it pings the server IP just fine. Problem is when I unplug the server and the IP pings fail it doesn't execute the reboot as I'm trying to make it. I've adjusted priveleges to be sure users can run the command. I'm getting a syntax error that i'm making an "unexpected end of file" argh! Here is the script I have:
Ping -n 123.45.678.910
if %errorlevel%==4 shutdown -ar -t 5
When i run this script and the server is connected to the LAN i get a nice steady stream of pings. When I unplug the cable the stream stops and what should happen is a reboot. However it just sits there. When i hit Ctrl+C to stop the script it gives me the syntax error: unexpected end of file.