Set CheckProcess = ObjWMIService.ExecQuery("Select * from Win32_Process WHERE Name='Thunder.exe'")
If CheckProcess.count<>0 Then
ProFlag = 0
Else
ProFlag = 1
End If
Set colMonitoredProcesses = objWMIService.ExecNotificationQuery("select * from __instancecreationevent " & " within 1 where TargetInstance isa 'Win32_Process'")
i = 0
Do While i = 0
Set CheckProcess = ObjWMIService.ExecQuery("Select * from Win32_Process WHERE Name='Thunder.exe'")
If CheckProcess.count<>0 Then
Wscript.Echo "迅雷已运行."
'监视网络
CurrentFlow
BeginFlow = CurrentFlowInt
'获取开始时接收的流量(字节)
Wscript.Echo "BeginFlow: " & BeginFlow
WScript.Sleep 120000
'定义时间范围
Else
Wscript.Echo "迅雷未运行."
Set objLatestProcess = colMonitoredProcesses.NextEvent
'监视迅雷
If objLatestProcess.TargetInstance.Name = "Thunder.exe" Then
Set CheckProcess = ObjWMIService.ExecQuery("Select * from Win32_Process WHERE Name='Thunder.exe'")
If CheckProcess.count<>0 Then
ProFlag = 0
Else
ProFlag = 1
End If
Set colMonitoredProcesses = objWMIService.ExecNotificationQuery("select * from __instancecreationevent " & " within 1 where TargetInstance isa 'Win32_Process'")
i = 0
Do While i = 0
Set CheckProcess = ObjWMIService.ExecQuery("Select * from Win32_Process WHERE Name='Thunder.exe'")
If CheckProcess.count<>0 Then
Wscript.Echo "迅雷已运行."
'监视网络
CurrentFlow
BeginFlow = CurrentFlowInt
'获取开始时接收的流量(字节)
Wscript.Echo "BeginFlow: " & BeginFlow
WScript.Sleep 120000
'定义时间范围
Else
Wscript.Echo "迅雷未运行."
Set objLatestProcess = colMonitoredProcesses.NextEvent
'监视迅雷
If objLatestProcess.TargetInstance.Name = "Thunder.exe" Then