

Executable = “The Path to the file you want to execute.” Since you’re going to use FireDaemon to babysit this application as a “process” you DON’T want to use the batch file.The name doesn’t matter so long as if you’re using multiple servers or instances on this server, you’ll want them named differently. Your setting will look something like this. You’ll want to “add a new service”, to do this hover over the + symbol and you will get a tool-tip. We assume you have already installed your dedicated server on windows, configured your serverconfig.xml with appropriate settings, and have your server in a directory located at c:\7d2d\
#SHUTDOWN TIMER BATCH FILE HOW TO#
Now, we won’t go into how to install and setup a dedicated server.
#SHUTDOWN TIMER BATCH FILE WINDOWS#
goto start timeout 3 :start startdedicated.batįireDaemon (opens new window) is a tool that allows you to run any programs as a Windows service. for /F "tokens=2" %%i in ( 'date /t ' ) do set mydate = %%i set mytime = %time% echo Restarting Server: %mydate%: %mytime% echo. Restarting the computer START C:\Windows\RUNDLL.EXE user.exe,exitwindowsexecĮxit Shut down the computer C:\Windows\RUNDL元2.Echo off title startdedicated.bat set LOGTIMESTAMP = IF EXIST 7DaysToDieServer.exe ( set GAMENAME =7DaysToDieServer set LOGNAME =output _log _dedi ) ELSE ( set GAMENAME =7DaysToDie set LOGNAME =output _log ) :: - :: REMOVE OLD LOGS (only keep latest 20) for /f "tokens=* skip=19" %%F in ( 'dir %GAMENAME%_Data\ %LOGNAME%*.txt /o -d /tc /b ' ) do del %GAMENAME%_Data\ %%F :: - :: BUILDING TIMESTAMP FOR LOGFILE :: Check WMIC is available WMIC.EXE Alias /? >NUL 2> & 1 || GOTO s_start :: Use WMIC to retrieve date and time FOR /F "skip=1 tokens=1-6" %%G IN ( 'WMIC Path Win32_LocalTime Get Day^ ,Hour^ ,Minute^ ,Month^ ,Second^ ,Year /Format :table ' ) DO ( IF "%%~L" = "" goto s_done Set _yyyy = %%L Set _mm = 00 %%J Set _dd = 00 %%G Set _hour = 00 %%H Set _minute = 00 %%I Set _second = 00 %%K ) :s_done :: Pad digits with leading zeros Set _mm = %_mm:~ -2 % Set _dd = %_dd:~ -2 % Set _hour = %_hour:~ -2 % Set _minute = %_minute:~ -2 % Set _second = %_second:~ -2 % Set LOGTIMESTAMP = _ _ %_yyyy% - %_mm% - %_dd% _ _ %_hour% - %_minute% - %_second% :s_start :: - :: STARTING SERVER echo|set /p= "251570" > steam_appid.txt set SteamAppId = 251570 set SteamGameId = 251570 set LOGFILE = %~dp0\ %GAMENAME% _Data\ %LOGNAME% %LOGTIMESTAMP%.txt echo Writing log file to: %LOGFILE% 7DaysToDieServer.exe -logfile "%LOGFILE%" -quit -batchmode -nographics -configfile=serverconfig.xml -dedicated echo.

Shut down and restart shortcut in Windows 95, 98, and MEĬreate a batch file with the following lines, corresponding to the action you want to perform.

Once the shortcut is named, click Finish.
