I never needed that with Pimax, but something learned at my day job, is to also do taskkill /IM PiServerLauncher.exe /F
So “refined” mega script is:
sc stop PiServiceLauncher & timeout 1 & taskkill /IM PiServerLauncher.exe /F & start PiServiceLaunch
Probably needs taskkill statements for all the Pimax services, but you get the idea.
Also I noticed that Pi services are not idle, even when HMD disconnected. Because my gaming requires a lot of tools started/stopped, I just start PiServiceLauncher as part of my game startup script and stop it after I am done.
Cheers