For all of you who are looking for a some what simple batch script to start and restart you server after a crash.
Selectable game,map,players,rcon,password,vac, and server restart.
@ echo off
title Jays Server Watch
echo ================================================
echo = Created By: Jay209015 =
echo = Email: jay209015@suddenlink.net =
echo ================================================
echo :Just follow directions, and enter your options:
echo ================================================
:game
cd c:\srcds\
attrib +h "hl2"
attrib +h "bin"
attrib +h "reslists"
attrib +h "platform"
dir /b/A-h *.
attrib -h "hl2"
attrib -h "bin"
attrib -h "reslists"
attrib -h "platform"
echo ________________________________________________
echo \ What game do you want to start a server for? /
echo /___________Options are listed above.__________\
set game=
set /p game=
if exist c:\srcds\%game%\ goto map
if not exist c:\srcds\%game%\ goto game_e
:game_e
echo,
echo :::::::::::::::::::_ERROR_::::::::::::::::::::::
echo :%game% Is not valid, Please re-enter selection:
echo ::::::::::::::::::::::::::::::::::::::::::::::::
goto game
:map
title Jays Server Watch (%game%)
echo ================================================
cd c:\srcds\%game%\maps\
dir /b/A *.bsp
echo ================================================
echo ________________________________________________
echo \ What map do you want to run on %game%? /
echo /___________Options are listed above.__________\
set map=
set /p map=
if exist "c:\srcds\%game%\maps\%map%.bsp" goto players
if not exist "c:\srcds\%game%\maps\%map%.bsp" goto map_e
:map_e
echo,
echo :::::::::::::::::::_ERROR_:::::::::::::::::::::
echo :%map% Is not valid, Please re-enter selection:
echo :::::::::::::::::::::::::::::::::::::::::::::::
goto map
:players
echo =================================================
echo ________________________________________________
echo \ How many players do you want to be allowed /
echo /_____________ In your server?_________________\
set players=
set /p players=
goto rcon
:rcon
echo =================================================
echo _________________________________________________
echo \Pleaser enter your rcon password now. Note if /
echo /_you don't enter a password you can't use rcon_\
set rcon=
set /p rcon=
goto password
:password
echo ==================================================
echo ________________________________________________
echo \ What would you like your server password /
echo /________to be?(TO SKIP PRESS ENTER)___________\
set password=
set /p password=
goto vac
:vac
echo ==================================================
echo ________________________________________________
echo \ Do you want your server to be VAC secured? /
echo /______________________________________________\
set vac=
set /p vac=yes/no:
if %vac%==yes set secured=
if %vac%==no set secured=-insecure
if %vac%==Yes set secured=
if %vac%==No set secured=-insecure
goto name
:name
echo ==================================================
echo ________________________________________________
echo \ Please enter a hostname, or default will /
echo /________________be used_______________________\
set name=
set /p name=
goto start
:start
echo ==================================================
echo ________________________________________________
echo \ Do you want the server to restart after /
echo /______________A server crash__________________\
set start=
set /p start=yes/no:
if %start%==yes goto srcds
if %start%==no goto srcds_no
if %start%==Yes goto srcds
if %start%==No goto srcds_no
:srcds
echo ===============================================
echo (%time%) %game% server started___________Auto Restart Enabled......Created by:jay209015.
start /wait c:\srcds\srcds.exe -console -game %game% +hostname %name% +rcon_password %rcon% +sv_password %password% %secure% +map %map% +maxplayers %players% > C:\test.txt
echo (%time%) WARNING: server closed or crashed, restarting.
goto srcds
:srcds_no
echo ================================================
echo (%time%) %game% server started___________Auto Restart disabled......Created by:jay209015.
start /wait c:\srcds\srcds.exe -console -game %game% +hostname %name% +rcon_password %rcon% +sv_password %password% %secure% +map %map% +maxplayers %players%
echo (%time%) WARNING: server closed or crashed.
echo ________________________________________________
echo \ Do you want the server to restart? /
echo /______________server crashed__________________\
set restart=
set /p restart=yes/no:
if %restart%==yes goto srcds_no
if %restart%==Yes goto srcds_no
if %restart%==no goto end
if %restart%==No goto end
:end
Copy and paste into notepad and save as anything.bat
This only works for the c:\srcds directory.