当前位置: 代码迷 >> vbScript >> VBS监控进程有关问题
  详细解决方案

VBS监控进程有关问题

热度:3295   发布时间:2013-02-26 00:00:00.0
VBS监控进程问题
怎么样用VBS监控ie的进程。一旦发现了新的IE进程出现,就弹出一下提示窗口。

------解决方案--------------------------------------------------------
VBScript code
    sProcess = "iexplore.exe"Set oWMI = GetObject("Winmgmts:")Set oExec  = oWMI.ExecNotificationQuery( _             "Select * From __instanceCreationEvent " & _             "WithIn 1 Where TargetInstance ISA 'Win32_Process'")Do    Set oNextEvent = oExec.NextEvent        sName = oNextEvent.TargetInstance.Name    If sProcess = LCase(sName) Then        MsgBox sName    End IfLoop
  相关解决方案