[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
回复 30# ygqiang


    谢谢你了,不过我的是win10系统哦

TOP

回复 29# solan
  1. (
  2.     wmic process where "name='lmgrd.exe'" get *
  3.     echo;==============
  4.     wmic service get *
  5. )>result.txt
  6. pause
复制代码
将result.txt用网盘分享出来

TOP

本帖最后由 solan 于 2017-3-28 10:38 编辑

回复 26# ShowCode


    你的对的,我刚才测试的时候搞错,你的代码运行显示:

Version=8.3.18038.0



请按任意键继续. . .

但是换了我的服务进程lmgrd.exe就不对了
没有可用实例。



请按任意键继续. . .

TOP

回复 32# pcl_test


  谢谢老大  链接:http://pan.baidu.com/s/1bpgopYZ 密码:zlof

TOP

本帖最后由 pcl_test 于 2017-3-28 11:52 编辑
  1. @echo off
  2. for /f %%a in ('wmic process where "name='lmgrd.exe'" get ProcessId /value 2^>nul ^|find "="') do (
  3.     setlocal enabledelayedexpansion
  4.     set %%a
  5.     for /f "delims=" %%b in ('wmic service where "ProcessId='!ProcessId!'" get PathName /value 2^>nul ^|find "="') do set %%b
  6.     for /f  %%c in ('wmic datafile where "Name='!PathName:\=\\!'" get Version /value 2^>nul ^|find "="') do set %%c
  7.     echo;!ProcessId!
  8.     echo;!PathName!
  9.     echo;!Version!
  10.     echo;
  11.     endlocal
  12. )
  13. pause
复制代码
结果贴出来看看
1

评分人数

TOP

本帖最后由 pcl_test 于 2017-3-28 11:57 编辑
  1. (
  2.     wmic process where "name='lmgrd.exe'" get ProcessId /value
  3.     echo;
  4.     wmic service where "PathName like '%%\\lmgrd.exe'" get Name,PathName,ProcessId /value
  5. )>tmp.txt
  6. pause
复制代码
将tmp.txt用网盘分享出来

TOP

回复 35# pcl_test


    47780
C:\ProgramData\nx4.0_flex\lmgrd.exe
11.6.1.0

29360



请按任意键继续. . .

TOP

本帖最后由 pcl_test 于 2017-3-28 19:04 编辑

回复 36# pcl_test
ProcessId=47780
ProcessId=29360

Name=NX4.0
PathName=C:\ProgramData\nx4.0_flex\lmgrd.exe
ProcessId=47780

TOP

回复 38# solan

36楼改下%%\\lmgrd.exe%%
重新运行看看结果

TOP

本帖最后由 pcl_test 于 2017-3-28 19:04 编辑

回复 39# pcl_test



ProcessId=47780
ProcessId=29360


Name=nx11
PathName="C:\Users\Administrator\Desktop\nx_flex\lmgrd.exe"
ProcessId=0


Name=NX4.0
PathName=C:\ProgramData\nx4.0_flex\lmgrd.exe
ProcessId=47780


Name=nx11.0
PathName="C:\Users\Administrator\Desktop\nx_flex\lmgrd.exe"
ProcessId=0

TOP

本帖最后由 pcl_test 于 2017-3-29 05:07 编辑

版本获取没问题,但进程和服务的ProcessId能对上的只有一个
  1. @echo off
  2. for /f "delims=" %%a in ('wmic service where "PathName like '%%\\lmgrd.exe%%'" get PathName /value 2^>nul ^|find "="') do (
  3.     setlocal enabledelayedexpansion
  4.     set %%a
  5.     set PathName=!PathName:"=!
  6.     echo;!PathName!
  7.     for /f %%c in ('wmic datafile where "Name='!PathName:\=\\!'" get Version /value 2^>nul ^|find "="') do set %%c
  8.     for /f "tokens=1-4 delims=." %%d in ("!Version!.0.0") do (
  9.         set /a #a=%%d+100000000,#b=%%e+100000000,#c=%%f+100000000,#d=%%g+100000000
  10.         if "!#a!.!#b!.!#c!.!#d!" leq "100000011.100000006.100000001.100000000" (
  11.             echo;11.6.1.0 ^>= !Version!
  12.         ) else echo;11.6.1.0 ^< !Version!
  13.     )  
  14.     echo;
  15.     endlocal
  16. )
  17. pause
复制代码
1

评分人数

TOP

本帖最后由 solan 于 2017-3-28 14:15 编辑

回复 41# pcl_test


    我这些服务,每个服务一开启就会有2个同名进程
你们的代码我一点不懂啊,好难啊

TOP

如果11.6.1.0版本的lmgrd.exe进程存在,我就保留,比他版本高的同名进程如果有的话全部结束

TOP

返回列表