????ν????????й????
???????????? ???????[ 2013/12/26 15:26:15 ] ???????????? ????? ??????
?????C++???B?????????API???д???????????API???10000?Σ???????????????Server?????????????????????й??????????API C ???9999999?ε??????Window Task Manager??????治??????????
????????VBScriptд????δ????????Server????dllhost:
Option Explicit
Dim strComputer?? processid?? Name?? interval
'CONFIGURATIONS
strComputer = "localhost"
'processid = 524
name = "dllhost"
interval = 300000
Dim objFSO?? objFolder?? objShell?? objTextFile?? objFile??oArgs??OSCaption??OScanExe??objRefresher??numCount
Dim strDirectory??strFile??logFile??strText??userTime??procTime??interTime??idleTime?? dayStr?? timeStr
Dim wbemServices??wbemObject??wbemObjectSet
'strDirectory = "."
'strFile = "c: empproc.txt"
'timeStr = replace(Time?? ":"?? ".")
'dayStr = replace(Day?? ""?? ".")
strText =""
logFile = name & "@" & replace(time?? ":"?? ".") & "%" & replace(date?? "/"?? ".") & "@" & strComputer & ".csv"
'WScript.echo logFile
' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
' Check that the strDirectory folder exists
'If objFSO.FolderExists(strDirectory) Then
'Set objFolder = objFSO.GetFolder(strDirectory)
'Else
'Set objFolder = objFSO.CreateFolder(strDirectory)
'WScript.Echo "Just created " & strDirectory
'End If
If objFSO.FileExists(logFile) Then
Set objFile = objFSO.GetFile(logFile)
Else
Set objFile = objFSO.CreateTextFile(logFile)
End If
Set objFile = nothing
set objFolder = nothing
' OpenTextFile Method needs a Const value
' ForAppending = 8 ForReading = 1?? ForWriting = 2
Const ForWriting = 2
Set objTextFile = objFSO.OpenTextFile (logFile?? ForWriting?? True)
'strComputer = "." ' Dot (.) equals local computer in WMI
Set wbemServices = Getobject("winmgmts:\" & strComputer)
Dim pName??pHandle??pProcess??pMem
Dim found?? strQuery?? wbemObjectSet1?? wbemObjectSet2?? wbemObject1
do
strQuery = "SELECT * FROM Win32_PerfFormattedData_PerfProc_Process where name LIKE 'dllhost%'"
Set wbemObjectSet = wbemServices.ExecQuery(strQuery?? ??48)
'if wbemObjectSet.size = 0 then WScript.Quit
found = 0
For Each wbemObject In wbemObjectSet
'check if the parent is svchost
strQuery = "SELECT * FROM Win32_PerfFormattedData_PerfProc_Process where IDProcess = " & wbemObject.CreatingProcessID
Set wbemObjectSet1 = wbemServices.ExecQuery(strQuery?? ??48)
for each wbemObject1 in wbemObjectSet1
if(wbemObject1.name = "svchost") then
'CONFIGURATION ALSO
'here?? you can output as you like
'for example??
'strText = strText & "??""" & XXXXXXXX & """"
'here?? XXXXXXXX is a filed specified in the file class Win32_PerfFormattedData_PerfProc_Process.txt
strText = """" & Date & " " & time & """"
strText = strText & "??""" & wbemObject.IDProcess & """"
strText = strText & "??""" & round((wbemObject.WorkingSet / 1048576)?? 1) & """"
strText = strText & "??""" & wbemObject.PercentProcessorTime& """"
strText = strText & "??""" & wbemObject.PercentUserTime& """"
objTextFile.WriteLine(strText)
end if
next
'strText = strText & "Name [" & pName & "] Handle [" & pHandle &"] PID ["&pProcess&"] Mem ["&pMem&"]" & vbCrLf
Next
'strText = strText & "--------------------------------------------------------------------" & vbCrLf
'WScript.echo strText
WScript.Sleep interval
loop
objTextFile.Close
WScript.Quit
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11