REM  Hitachi SVP                              
REM  JAVA Update tool for Hitachi SVP
REM                 Copy right. 2015  Hitachi. Ltd. 
REM
REM History  :Version    :DATE        : Coder        : Patch No
REM Hitachi SVP
REM          :01-01      :2015.05.21  : S.Moriya  : Y8012222998 (New)
REM          :01-02      :2018.02.16  : Y.Kumagai : #44854 (Remote Micro Exchange Support)
REM
echo off
set REGCRED2="RegCred.bat"
set TOMCAT_START="tomcat_start.bat"
set LOGFILE="c:\dkc200\san\cgi-bin\Utility\JavaUpdate_log.txt"

net stop "SVPAccountManager" >> %LOGFILE% 2>>&1

REM timeout /T 10 >> %LOGFILE% 2>>&1

SET SVPAM_STOP_FLG=0
  for /f "tokens=1" %%i in ('tasklist /fi "IMAGENAME eq SVPAccountService.exe"') do (
    IF "%%i"=="SVPAccountService.exe" (
      SET SVPAM_STOP_FLG=1
    )
  )

  IF %SVPAM_STOP_FLG%==1 (
	pushd %~dp0
	call %REGCRED2%  >> %LOGFILE% 2>>&1

  	echo SVPAccountManager can not stop >> %LOGFILE% 2>>&1
  	echo SVPAccountManager can not stop
	exit 242
  )
 
exit /b 0

