- ' FileName: ProcessMagnifier.vbs
- ' Function: Capture information about the running processes in detail
- ' code by somebody
- ' QQ: 240460440
- ' LastModified:2007-11-16 18:25
- ' 仅供学习
- Const HKEY_CURRENT_USER = &H80000001
- oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
- strKeyPath = "Console\%SystemRoot%_system32_cmd.exe"
- oReg.CreateKey(HKEY_CURRENT_USER, strKeyPath)
- strValueName1 = "CodePage"
- dwValue1 = 936
- strValueName2 = "ScreenBufferSize"
- dwValue2 = 98304200
- strValueName3 = "WindowSize"
- dwValue3 = 2818173
- strValueName4 = "HistoryNoDup"
- dwValue4 = 0
- strValueName5 = "WindowPosition"
- dwValue5 = 131068
- strValueName6 = "QuickEdit"
- dwValue6 = 2048
- oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName1, dwValue1)
- oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName2, dwValue2)
- oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName3, dwValue3)
- oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName4, dwValue4)
- oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName5, dwValue5)
- oReg.SetDWORDValue(HKEY_CURRENT_USER, strKeyPath, strValueName6, dwValue6)
- Dim objWSH, FinalPath
- objWSH = WScript.CreateObject("WScript.Shell")
- If (LCase(Right(WScript.Fullname, 11)) = "wscript.exe") Then
- FinalPath = "'" & WScript.ScriptFullName & "'"
- objWSH.Run("cmd.exe /k cscript //nologo " & Replace(FinalPath, "'", """"))
- WScript.Quit()
- End If
- oReg.DeleteKey(HKEY_CURRENT_USER, strKeyPath)
- oReg = Nothing
- WScript.Echo()
- WScript.Sleep(1000)
- WScript.Echo("当前正在运行的进程简要信息列表如下:")
- 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("当前正在运行的进程以及其加载的模块详细信息树状结构如下:")
- 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&"创建时间 文件制造商"
- 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
ProcessMagnifier.vbs进程查看代码
2020-07-23 11:07VBS代码网 VBS
这个vbs主要用于查看当前进程信息的脚本代码,有需要的朋友可以参考下
延伸 · 阅读
- 2022-03-09C# 获取进程退出代码的实现示例
- 2022-03-08详解Linux监控重要进程的实现方法
- 2022-03-08Python的进程及进程池详解
- 2022-03-07C#获取所有进程的方法
- 2022-03-01java高并发之理解进程和线程
- 2022-02-24易语言关于程序进程和线程的基础知识
精彩推荐
- VBS
可以定时自动关机的vbs脚本
这篇文章主要分享一段可以定时自动关机的vbs脚本代码,有需要的童鞋可以学习下...
- VBS
提供个可以显示农历的VBS代码
本文主要分享一段可以显示农历的VBS代码,具有一定的参考价值,有需要的朋友可以了解一下...
- VBS
VBS教程:属性-VolumeName 属性
VBS教程:属性-VolumeName 属性...
- VBS
VBS教程:属性-AvailableSpace 属性
VBS教程:属性-AvailableSpace 属性 ...
- VBS
vbs base64 解密脚本代码
解密base64的vbs小函数,支持英文与数字不支持中文。...
- VBS
VBS教程:对象-Folders 集合
VBS教程:对象-Folders 集合...
- VBS
脚本 MsAgent组件 微软精灵 揪出系统自带的宠物
你知道系统里有一个隐藏的宠物吗? 将以下代码保存为后缀为.vbs的文件,再双击运行,看看出来什么?一个可爱的魔法老人!还会说话、移动、吹喇叭…...
- VBS
VBS教程:正则表达式简介 -建立正则表达式
建立正则表达式 构造正则表达式的方法和创建数学表达式的方法一样。也就是用多种元字符与操作符将小的表达式结合在一起来创建更大的表达式。 可以...