SETLOCAL EnableExtensions set EXE=FLServer.exe goto Schleife :Schleife PING localhost -n 6 >NUL FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND taskkill /f /im flserver.exe PING localhost -n 3 >NUL taskkill /f /im flserver.exe PING localhost -n 3 >NUL taskkill /f /im flserver.exe PING localhost -n 3 >NUL taskkill /f /im flserver.exe PING localhost -n 3 >NUL taskkill /f /im flserver.exe PING localhost -n 3 >NUL start flserver.exe /c /p2302 echo FLServer is started goto Schleife :FOUND echo FLServer is running exit