ItsMods

Full Version: Server Restart Batch File
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When I was running AlterIW servers I had a bat file that would restart the server if it crashed or disconnected.

Now Im running legit MW3 servers and it's been so long I forgot what it was. Lost to time.

Can someone please remind me of what to do?

Is it better to use firedameon than a restart bat script?


Thanks.........
This is just off the top of my head:

Code:
@echo off

:restart

set %errorlevel%=0
start /NORMAL /WAIT "PATH_TO_FILE"
if not (%errorlevel%==0) goto errorend

goto restart

:errorend

echo An error occurred.
pause > nul
Wow that was quick man. Thanks.

So how do I use the command line in this?

Like so?

@echo off

:restart

set %errorlevel%=0
start /NORMAL /WAIT "C:\HLDS\MIX\iw5mp_server.exe +set sv_config "server.cfg" +set dedicated 2 +set net_queryPort 28960 +set net_port 27015 +set net_authPort 8766 +set net_masterServerPort 27016 +start_map_rotate"
if not (%errorlevel%==0) goto errorend

goto restart

:errorend

echo An error occurred.
pause > nul

I cant get it to run it just brings up an empty dos box. I also just tried it like so

start /NORMAL /WAIT "C:\HLDS\MIX\iw5mp_server.exe"

Least I got the "NooB" part right in my screen name. lol