@ECHO OFF
REM

@ECHO.
ECHO ***************************
ECHO ***   Stop XFS Service  ***
ECHO ***************************
@ECHO.
sc stop ProDevice
timeout /t 3

REM Remove ProDevice Service
REM
FOR /F %%m IN ('C:\"Program Files"\Yass\PCCfgReg.exe /r "HKEY_LOCAL_MACHINE\SOFTWARE\Wincor Nixdorf\PROBASE\CurrentVersion" XFSROOT') DO SET _XFS_ROOT_=%%m
IF NOT EXIST %_XFS_ROOT_%\BIN\ProDeviceServiceRemove.bat GOTO AFTER_PRODEVICE1
@ECHO.
ECHO *****************************
ECHO ***   Remove XFS Service  ***
ECHO *****************************
@ECHO.
start /b %_XFS_ROOT_%\BIN\ProDeviceServiceRemove.bat
:AFTER_PRODEVICE1
SET _XFS_ROOT_=



REM Call CSCWINIT
REM
FOR /F %%m IN ('C:\"Program Files"\Yass\PCCfgReg.exe /r "HKEY_LOCAL_MACHINE\SOFTWARE\Wincor Nixdorf\CSC-W32\CurrentVersion" CSCROOT') DO SET _CSCW_ROOT_=%%m
IF NOT EXIST %_CSCW_ROOT_%\BIN\CSCWINIT.EXE GOTO AFTER_CSCWINIT
@ECHO.
ECHO *************************
ECHO ***   Call CSCWINIT   ***
ECHO *************************
@ECHO.
%_CSCW_ROOT_%\BIN\CSCWINIT.EXE
:AFTER_CSCWINIT
SET _CSCW_ROOT_=



REM Call ProDevice
REM
FOR /F %%m IN ('C:\"Program Files"\Yass\PCCfgReg.exe /r "HKEY_LOCAL_MACHINE\SOFTWARE\Wincor Nixdorf\PROBASE\CurrentVersion" XFSROOT') DO SET _XFS_ROOT_=%%m
IF NOT EXIST %_XFS_ROOT_%\BIN\prodevicestart.bat GOTO AFTER_PRODEVICE2
@ECHO.
ECHO *******************************
ECHO ***   Start XFS as Process  ***
ECHO *******************************
@ECHO.
CALL %_XFS_ROOT_%\BIN\prodevicestart.bat
:AFTER_PRODEVICE2
SET _XFS_ROOT_=

taskkill /IM cmd.exe