Netcool/OMNIbus MT Ping Probe - Version 7.2.1
(C) Copyright IBM Corp. 1994, 2007
5/16/2009 10:58:09 PM: Debug: D-UNK-105-000: Netcool/OMNIbus Probe API Library Version 7.2.1
5/16/2009 10:58:09 PM: Debug: D-UNK-105-000: API Release ID: 5.11.18
5/16/2009 10:58:09 PM: Debug: D-ETC-105-001: Added property SSLServerCommonName
5/16/2009 10:58:09 PM: Debug: D-ETC-105-001: Added property ServerBackup
Netcool/OMNIbus Ping probe - Version 7.2.1
(C) Copyright IBM Corp. 1994, 2007
Netcool/OMNIbus Probe API Library Version 7.2.1
Release ID: 4.0.3261
API Release ID: 5.11.18- @echo off
- REM ****************************************
- REM ** File Name : ProbeInfo.bat **
- REM ****************************************
-
- REM *** parameters check, just in the case of there are two parameters to process next ***
- if "%1" EQU "" (
- goto :endofargs
- ) else if "%2" EQU "" (
- goto :endofargs
- )
-
- REM *** set the path probes located and make the path to short format ***
- set ProbePath=%OMNIHOME%\probes\win32 *OMNIHOME = C:\Program Files\Omnibus\Teac*
- for %%x IN ("%ProbePath%") DO set ProbePath=%%~sx *将路径去空格*
-
- REM *** task specified ***
- if /i "%1" EQU "-version" (
- goto :versionQuery
- ) else if /i "%1" EQU "-buildNo" (
- goto :buildnoQuery
- ) else (
- goto :endofargs
- )
-
- REM *** version query section ***
- :versionQuery
- for /F "delims=- tokens=2" %%i IN ('%ProbePath%\%2 -version 2^>^&1 ^| find /V "Debug" ^| find /I "probe" ^| find /V "API" ^| find /V " MT "') DO (
- for /F "tokens=2" %%j IN ("%%i") DO echo %%j
- )
- goto :exit
-
- REM *** build number query section ***
- :buildnoQuery
- for /F "tokens=3" %%i IN ('%ProbePath%\%2 -version 2^>^&1 ^| find /V "Debug" ^| find "Release ID" ^| find /V "API"') DO echo %%i
- goto :exit
-
- :endofargs
- echo "Bad parameter, please input parameters correctly..."
- echo "1. ProbeInfo.bat -version PROBE_NAME"
- echo "2. ProbeInfo.bat -buildNo PROBE_NAME"
-
- :exit
复制代码 此脚本是用来获取回显(类似于代码上面的东西)中的特定内容的,而这个回显的输出是标准错误输出;所以需要用到输出的重定向。至于执行文件的路径中有空格的问题,加双引号的方法试过了(加什么位置都试过),可都是以失败告终。最终我采纳了另一方法,将路径短化、去空格化。
最终就解决了。 |