' FileName:ProcessMagnifier.vbs
' Function:capture information about the running processes in detail
' Code by somebody
' qq:240460440
' Lastmodified:2007-11-16 18:25
' For learning only
WScript.Echo ()
Wscript.Sleep (1000)
WScript.Echo ("Current Running Process summary Information list is as follows:")
WScript.Echo (VbCrLf)
Wscript.Sleep (2000)
Dim Myobjprocessname
objwmiprocess = GetObject ("winmgmts:\\.\root\cimv2"). ExecQuery ("SELECT * from Win32_Process")
WScript.Echo "Name:Priority:PID:Owner:" &vbTab&vbTab& "ExecutablePath:"
WScript.Echo ("---------------------------------------------------------------------------------------")
For each objprocess in objwmiprocess
myobjprocessname=objprocess.name& ""
Colproperties = Objprocess.getowner (strNameOfUser, strUserDomain)
WScript.Echo Mid (myobjprocessname,1,20) &vbTab& objprocess.priority &vbTab& Objprocess.processid &vbTab& strNameOfUser &vbTab&vbTab& Objprocess.executablepath
Next
Wscript.Sleep (5000)
WScript.Echo (VbCrLf)
WScript.Echo ("The currently running process and its loaded module details tree structure is as follows:")
WScript.Echo (VbCrLf)
Wscript.Sleep (3000)
WScript.Echo Vbtab&vbtab&vbtab&vbtab&vbtab&vbtab&vbtab&vbtab&vbtab&vbtab &vbTab&vbTab&vbTab&vbTab&vbTab&vbTab& vbtab& "Create Time file Manufacturer"
objWMIService = GetObject ("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
Objrefresher = CreateObject ("Wbemscripting.swbemrefresher")
Colitems = Objrefresher.addenum (objWMIService, "win32_perfformatteddata_perfproc_fullimage_costly"). Objectset
Objrefresher.refresh ()
For each objitem in colitems
Dim Originalpath, Modulepath, Wmipathmode, Filemanufacturer, Lcasemodulepath
Dim FileExtension, Mark, Mylcasemodulepath, Finalmodulepath
Originalpath = objItem.Name
Modulepath = Split (Originalpath, "/")
Wmipathmode = Replace (Modulepath (1), "\", "\ \")
OBJWMI = GetObject ("winmgmts:\\.\root\cimv2")
Colmanufacturer = Objwmi. ExecQuery ("select * from Cim_datafile Where name= '" & Wmipathmode & "")
For each objmanufacturer in Colmanufacturer
Filemanufacturer = Trim (objmanufacturer.manufacturer)
Lcasemodulepath = LCase (Trim (objmanufacturer.name))
FileExtension = Right (Lcasemodulepath, 3)
Mylcasemodulepath = Lcasemodulepath & " "
FSO = CreateObject ("Scripting.FileSystemObject"). GetFile (Lcasemodulepath)
If fileextension = "EXE" Then
Mark = "├-"
Finalmodulepath = Mid (Mylcasemodulepath, 1, 118)
WScript.Echo ("│")
Else
Mark = "│├─"
Finalmodulepath = Mid (Mylcasemodulepath, 1, 116)
End If
WScript.Echo Mark & Finalmodulepath & FSO. DateCreated &vbTab& Filemanufacturer
Next
Next
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.