@ECHO off
set programname=CSGO Admin
set servername=Install/Update Dedicated Server
LIGNECHANGE
set namegame=Counter-Strike: Global Offensive
set adsilog=csgo_script
set websitehelp=https://veydunet.com
title %programname% - %servername%
Color 0A
:restart
:start
cls
ECHO   =============================================================
ECHO    Install/Update Dedicated Server
ECHO    %namegame%
ECHO   =============================================================
ECHO   #############################################################
ECHO   #                                                           #
ECHO   # -Select and continue                                      #
ECHO   #                                                           #
ECHO   # 1 - CSGO Admin first use? Update SteamCMD!                #
ECHO   #                                                           #
ECHO   # 2 - First installation or Update Server                   #
ECHO   #                                                           #
ECHO   # 3 - Installation crash, continue installation             #
ECHO   #                                                           #
ECHO   # 4 - Successful installation/Update quit                   #
ECHO   #                                                           #
ECHO   # 5 - HELP!                                                 #
ECHO   # 6 - Exit                                                  #
ECHO   #                                                           #
ECHO   #############################################################
ECHO.
SET "A="
SET /P A=Set Your Choice And Press Enter: 
ECHO Loading .........
IF "%A%"=="1" >> "%adsilog%.log" ECHO (%date%)(%time%) Update SteamCMD.
IF "%A%"=="1" GOTO update_steam
IF "%A%"=="2" GOTO first_install
IF "%A%"=="3" GOTO first_install
IF "%A%"=="4" >> "%adsilog%.log" ECHO (%date%)(%time%) Successful close.
IF "%A%"=="4" EXIT
IF "%A%"=="5" >> "%adsilog%.log" ECHO Help!.
IF "%A%"=="5" START %websitehelp%
IF "%A%"=="5" PAUSE
IF "%A%"=="5" GOTO start
IF "%A%"=="6" >> "%adsilog%.log" ECHO (%date%)(%time%) Script close.
IF "%A%"=="6" EXIT
:first_install
ECHO.
ECHO %programname% has been started!
ECHO.
ECHO (%date%)(%time%) %servername% is now DOWNLOAD
ECHO Watching %servername% for crashes or close...
>> "%adsilog%.log" ECHO Server install: %namegame%
>> "%adsilog%.log" ECHO (%date%)(%time%) %servername% is now DOWNLOAD
>> "%adsilog%.log" ECHO (%date%)(%time%) Watching %servername% for crashes or close...
start /wait steamcmd %xcmd%
ECHO (%time%) WARNING: srcds closed or crashed, restarting.
ECHO.
ECHO (%date%)(%time%) Crash or Close detected!
ECHO %servername% is now restarting...
>> "%adsilog%.log" ECHO (%date%)(%time%) Crash or Close detected!
GOTO restart 
:update_steam
start steamcmd +quit
GOTO restart
