本帖最后由 pcl_test 于 2017-3-29 05:07 编辑
版本获取没问题,但进程和服务的ProcessId能对上的只有一个- @echo off
- for /f "delims=" %%a in ('wmic service where "PathName like '%%\\lmgrd.exe%%'" get PathName /value 2^>nul ^|find "="') do (
- setlocal enabledelayedexpansion
- set %%a
- set PathName=!PathName:"=!
- echo;!PathName!
- for /f %%c in ('wmic datafile where "Name='!PathName:\=\\!'" get Version /value 2^>nul ^|find "="') do set %%c
- for /f "tokens=1-4 delims=." %%d in ("!Version!.0.0") do (
- set /a #a=%%d+100000000,#b=%%e+100000000,#c=%%f+100000000,#d=%%g+100000000
- if "!#a!.!#b!.!#c!.!#d!" leq "100000011.100000006.100000001.100000000" (
- echo;11.6.1.0 ^>= !Version!
- ) else echo;11.6.1.0 ^< !Version!
- )
- echo;
- endlocal
- )
- pause
复制代码
|