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 start FLServer.exe /c /p2302 goto Schleife :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 restarted exit