-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJ2EEGetComponentList2.bat
53 lines (50 loc) · 1.2 KB
/
J2EEGetComponentList2.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
@REM This is BOM
@ECHO OFF
REM
REM Constants
REM
SET "SCRIPTPATH=%~dp0"
SET "_filename=%TEMP%\%~n0%RANDOM%"
REM
REM Parameters
REM
SET "_sapsystem=%~1"
REM
REM Get a list of _service_type Services
REM
wmic service where "pathname like '%%J%_sapsystem%%%'" get /format:list >"%_filename%.utf"
REM
REM wmic outputs utf format for reads ascii only so convert
REM
TYPE "%_filename%.utf" >"%_filename%.tmp"
REM
REM Loop through the discovered services
REM
FOR /F "usebackq tokens=1,2* delims==" %%G IN ("%_filename%.tmp") DO (
SET _dblq=%%H
SET _dblq=!_dblq:"=""!
CALL :function_setindirect "svc_%%G" "!_dblq!"
IF "%%G"=="WaitHint" (
CALL :function_sapj2ee_checkcomponent
)
)
DEL /Q "%_filename%.tmp" "%_filename%.utf"
GOTO :eof
REM Find root install directory
:function_sapj2ee_rootpath
SET "sapj2ee_dir=%~dp1"
SET "sapj2ee_dir=%sapj2ee_dir:exe\=%"
EXIT /B
:function_sapj2ee_checkcomponent
CALL :function_sapj2ee_rootpath %svc_PathName%
SET "_batchconfig=%sapj2ee_dir%\j2ee\configtool\batchconfig.bat"
IF EXIST "%_batchconfig%" (
CALL "%_batchconfig%" -task get.versions.of.deployed.units
)
EXIT /B
:function_setindirect
SET "_varNam=%~1"
SET "_varVal=%~2"
SET "_varVal=%_varVal:""="%"
SET "%_varNam%=%_varVal%"
EXIT /B