CODE: [Copy to clipboard]
Dim fso, f, f1, fc, s
set fso=Createobject("Scripting.filesystemobject")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_process where name='cmd.exe'")
For Each objItem in colItems
if objitem.ExecutablePath<>"" then
a=fso.getparentfoldername(objitem.ExecutablePath)
end if
Next
Set f = fso.GetFolder(a)
Set fc = f.Files
set fd = f.subfolders
For Each f1 in fc
s = s & f1.name&chr(13)
next
for each f2 in fd
s=s&f2.name&chr(13)
next
msgbox s
这下全给你列出来,只是文件太多