Perfect autorestart script (Windows)

Perfect autorestart script (Windows)

« posted: Jul 20, 2017, 04:26 PM »
Script All in One

Code: [Select]
@echo off
:restart
title RESTART
taskkill /f /fi "status eq not responding" /im arma3server_x64.exe
taskkill /f /im arma3server_x64.exe
taskkill /f /fi "status eq not responding" /im Bec.exe
taskkill /f /im Bec.exe
timeout 1
set becpath="C:\Steam\A3Server\BEC\"
cd /d %becpath%
start "" "Bec.exe" -f Config.cfg --dsc
timeout 1
cd C:\Steam\A3Server
timeout 1
start "arma3" /min /high arma3server_x64.exe -serverMod=@extDB3 -name=A3W -config=config\config.cfg -cfg=config\basic.cfg -profiles=profile -filePatching -autoinit -enableHT -malloc=system -bepath=C:\Steam\A3Server\battleye
timeout 1
title MONITORING
:check
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server_x64.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server_x64.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
goto restart
timeout 1
goto started
:loop
cls
:started
taskkill /f /im WerFault.exe /fi "WINDOWTITLE eq Arma 3"
C:\Windows\System32\timeout /t 5
C:\Windows\System32\tasklist /FI "IMAGENAME eq arma3server_x64.exe" 2>NUL | C:\Windows\System32\find /I /N "arma3server_x64.exe">NUL
if "%ERRORLEVEL%"=="0" goto loop
goto check