Hallo Herr Frankenstein, nochmal vielen Dank für die Hilfe! Dies hat nun geklappt. Habe noch eine kleinigkeit geändert da ansonsten die my_stop.bat nicht funktioniert hatte.
Auch habe ich hier:
die Startparameter hinterlegt. Dies funktioniert nun genau wie gewünscht.
Die Affinity legt die Anzahl der Kerne/Threads fest.
Die start.bat sieht nun wie folgt aus:
Code
@echo off
set PROCESSNAME=RustDedicated.exe
::First save current pids with the wanted process name
setlocal EnableExtensions EnableDelayedExpansion
set "RETPIDS="
set "OLDPIDS=p"
for /f "TOKENS=1" %%a in ('wmic PROCESS where "Name='%PROCESSNAME%'" get ProcessID ^| findstr [0-9]') do (set "OLDPIDS=!OLDPIDS!%%ap")
::Spawn new process(es)
start /affinity 3840 RustDedicated.exe -batchmode ^
+server.port 28015 ^
+server.maxplayers 60 ^
+server.saveinterval 60 ^
+server.levelurl "https://meineDomain.de/files/Map/UnsereSuperCustomMap.map" ^
+server.hostname "[DE|EU]Super-Toller-Server-Name" ^
+server.identity "Server" ^
+rcon.port 28016 ^
+rcon.password MeinAbsolutSicheresPasswort ^
+rcon.web 1 ^
-freezecheck ^
::Check and find processes missing in the old pid list
for /f "TOKENS=1" %%a in ('wmic PROCESS where "Name='%PROCESSNAME%'" get ProcessID ^| findstr [0-9]') do (
if "!OLDPIDS:p%%ap=zz!"=="%OLDPIDS%" (set "RETPIDS=%%a !RETPIDS!")
)
echo %RETPIDS% > pid.txt
endlocal
Alles anzeigen
Hier nun die my_stop.bat:
Code
@echo off
for /f %%i in (pid.txt) do (
set PID=%%i
)
echo %PID%
taskkill /f /pid %PID%
del pid.txt
Vielen Dank nochmal für die Hilfe