Launching a SteamCMD server issues

Okay, I’ve done a fresh install of my server, and I have this batch code…

The directory where srcds.exe is, is C:\srcds4\srcds.exe
I used to run SRCDS guardian, but that doesn’t work for some reason. How do I fill this batch file out to launch a gmod server? As it is now, there isn’t a gmod option…

Surely someone could help? All i need help with is a code to launch the server… It worked fine, but then i installed CS:S content, and all it does is open and close straight away…

Do you only use this batch file for your GMod server? If so, continue. If not, reply and I’ll modify my suggestions.

Few things I’ve noticed:



set runcmd=C:\srcds4\orangebox\srcds.exe -console -game %gamename% -maxplayers %maxplayers% -port %port% +map %mapname% +gamemode %gamemode% -disableluarefresh


This is okay on it’s own but then you do this:


CD %runcmd%

I don’t know if you know much about Batch but try do this instead



set directory=C:\srcds4\orangebox\
set runcmd=srcds.exe -console -game %gamename% -maxplayers %maxplayers% -port %port% +map %mapname% +gamemode %gamemode% -disableluarefresh


and replace the CD command with:


CD %directory%

You also have references to %gamename%, %maxpalayers%, %port%, %mapname% and %gamemode% that I don’t see in set in your batch script. Unless you are setting this in another way that I cannot see, add this to the top, replacing the values after the ‘=’ with what you want.



set gamename=garrysmod
set maxplayers=24
set port=27015
set mapname=gm_construct
set gamemode=sandbox


I noticed this:


start /wait steamcmd +login %username% %password% +force_install_dir %runcmd%%app%Server\ +app_update %app% validate

Do you really want to update the server every time it crashes? If so then replace it with this (otherwise, delete it):


start /wait steamcmd +login anonymous +force_install_dir %directory% +app_update 4010 validate

replacing “steamcmd”, with the location to steamcmd.exe.

You can also remove this unneeded part since you’re only using this for a GMod server (or you ignored my previous warning):



:start
ECHO.
ECHO.
ECHO ################################################## ############
ECHO # Dedicated Server #
ECHO # 1 - Half-Life: Deathmatch and Counter-Strike #
ECHO # 2 - Counter-Strike: Global Offensive #
ECHO # 3 - Nuclear Dawn Dedicated Server #
ECHO # 4 - Red Orchestra Dedicated Server #
ECHO # 5 - Red Orchestra 2: Heroes of Stalingrad Dedicated Server #
ECHO # 6 - Killing Floor Dedicated Server #
ECHO # 7 - Team Fortress 2 Dedicated Server Beta #
ECHO # 8 - HELP! #
ECHO # 9 - Exit #
ECHO ################################################## ############
ECHO.
ECHO.

:: Delete variable %A%
SET "A="
SET /P A=Set Your Choice And Press Enter: 
ECHO Loading .........
IF "%A%"=="1" set app=90 
IF "%A%"=="2" set app=740
IF "%A%"=="3" set app=111710
IF "%A%"=="4" set app=223240
IF "%A%"=="5" set app=212542
IF "%A%"=="6" set app=215350
IF "%A%"=="7" set app=229830
IF "%A%"=="8" ECHO.
IF "%A%"=="8" ECHO https://developer.valvesoftware.com/wiki/SteamCMD
IF "%A%"=="8" ECHO.
IF "%A%"=="8" PAUSE
IF "%A%"=="8" goto start
IF "%A%"=="9" EXIT


Finally, you don’t actually have the actual server start command. Below your steamcmd (or instead of it if you removed it), insert this:


start /wait %runcmd%

Awesome, thank you a lot Bo. Server works now. <3