本帖最后由 floor6ggg 于 2020-1-4 22:39 编辑
原帖的代码相当强大!!!!!!
我稍稍修改了一下,方便查看你想要的结果$objWMIService = ObjGet("winmgmts:\\.\root\CIMV2:win32_process")
$colItems = $objWMIService.instances_
$i=0
For $objItem In $colItems
If $objItem.Name ='svchost.exe' Then
$Pid = "Pid: " & $objItem.ProcessId
$Name = "Name: " & $objItem.Name
$path = "Path: " & $objItem.executablepath
consolewrite($i&@tab&''&@tab&$Pid&@tab &$Name&@tab &$path&@crlf)
$i +=1
EndIf
Next
测试的结果+>执行环境:
+> CPU构架: X64
+> 系统构架: X64
+> 系统语言: 0804
+> 键盘布局: 00000804
+> 内存总量: 16308MB
+> 内存剩余: 11796MB
+> 操作系统: WIN_81
+> AU3版本: 3.3.14.3
+> ============================================
>运行 AU3Check (3.3.14.3) 开始目录:D:\autoit3
+>22:25:43 AU3Check 完成[CODE]:0
>运行:(3.3.14.3):D:\autoit3\autoit3_x64.exe "C:\Users\XP\Desktop\test.au3"
0 Pid: 544 Name: svchost.exe Path: C:\Windows\system32\svchost.exe
1 Pid: 928 Name: svchost.exe Path: C:\Windows\system32\svchost.exe
2 Pid: 1120 Name: svchost.exe Path: C:\Windows\system32\svchost.exe
3 Pid: 1176 Name: svchost.exe Path: C:\Windows\system32\svchost.exe
...............................................中间省略70多条记录......................................................
80 Pid: 2784 Name: svchost.exe Path: C:\Windows\System32\svchost.exe
81 Pid: 16176 Name: svchost.exe Path: C:\Windows\system32\svchost.exe
82 Pid: 9064 Name: svchost.exe Path:
83 Pid: 15448 Name: svchost.exe Path: C:\Windows\system32\svchost.exe
+>22:25:44 AutoIt3.exe 完成:[CODE]:0
+>22:25:45 ACNWrapper 完成..
>退出代码: 0 运行时间: 2.751 秒
|