Skip to content

Instantly share code, notes, and snippets.

@lolmaus
Created February 11, 2022 08:46
Show Gist options
  • Save lolmaus/b94a2eaa5b4d02602f2feb458b007bc2 to your computer and use it in GitHub Desktop.
Save lolmaus/b94a2eaa5b4d02602f2feb458b007bc2 to your computer and use it in GitHub Desktop.
C:\Users\lolmaus\AppData\Roaming\FAHClient\fah_restart.bat
@echo off
chcp 1251 >nul
set ln=Процесс fahcore найден!
set msg=FAHClient был перезапущен
chcp 866 >nul
:loop
cd %appdata%\FAHClient\
tasklist /fi "imagename eq fahcore_21.exe" | find /i "fahcore_21.exe" > nul
if not errorlevel 1 set res=true
tasklist /fi "imagename eq fahcore_22.exe" | find /i "fahcore_22.exe" > nul
if not errorlevel 1 set res=true
if defined res ( Echo %date% %time:~0,2%:%time:~3,2% %ln% ) else (
taskkill /f /im "FAHClient.exe" & start "" /min "%PROGRAMFILES(x86)%\FAHClient\FAHClient.exe" & echo %date% %time:~0,2%:%time:~3,2% %msg%
)
set res=
timeout 900
Goto :loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment