set _pid=0
for /f "tokens=3" %%a in ('sc queryex MaximusService ^| findstr PID') do (set _pid=%%a)
if %_pid% gtr 0 (
     call sc stop MaximusService
     taskkill /F /PID %_pid%
)
cd C:\DET\MxService\
MxService.exe uninstall
MxService.exe install