VBS 如何获取所有进程的路径?
答案:2 悬赏:40 手机版
解决时间 2021-01-30 00:16
- 提问者网友:鐵馬踏冰河
- 2021-01-29 11:59
VBS 如何获取所有进程的路径?
最佳答案
- 五星知识达人网友:天凉才是好个秋
- 2021-01-29 12:27
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)For Each objItem in colItems
WScript.Echo "进程名: " & objItem.Caption
WScript.Echo "路 径: " & objItem.ExecutablePath
WScript.Echo ""
Next 很多进程是读取不到路径的..
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)For Each objItem in colItems
WScript.Echo "进程名: " & objItem.Caption
WScript.Echo "路 径: " & objItem.ExecutablePath
WScript.Echo ""
Next 很多进程是读取不到路径的..
全部回答
- 1楼网友:鸠书
- 2021-01-29 13:53
@echo off & title 进程查看
::start taskmgr
color 2
:s
set hh=smss.exe csrss.exe winlogon.exe services.exe lsass.exe svchost.exe explorer.exe
::wmic process get executablepath
@echo\
@echo/
set /p hh=请输入映像名称:
for /f "delims=" %%i in ('wmic process get executablepath ^|findstr /i "%hh%"') do (@echo %%i & explorer /select,%%i)
goto s
这样就可以批量查看了,只是隐藏的文件是无法找出来的。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯