2015-11-18 21:44:14 +01:00
|
|
|
Option Explicit
|
|
|
|
KillBrowsers()
|
|
|
|
|
|
|
|
Sub KillBrowsers()
|
|
|
|
'Declare variables
|
|
|
|
Dim i
|
|
|
|
Dim wmiSvc,WQL,Processes,Process
|
2015-11-18 22:10:07 +01:00
|
|
|
Dim arrBrowserProcesses(8)
|
2015-11-18 21:44:14 +01:00
|
|
|
|
|
|
|
'Initialize variables
|
|
|
|
arrBrowserProcesses(0)="iexplore.exe"
|
|
|
|
arrBrowserProcesses(1)="chrome.exe"
|
|
|
|
arrBrowserProcesses(2)="firefox.exe"
|
|
|
|
arrBrowserProcesses(3)="safari.exe"
|
|
|
|
arrBrowserProcesses(4)="opera.exe"
|
|
|
|
arrBrowserProcesses(5)="iron.exe"
|
|
|
|
arrBrowserProcesses(6)="MicrosoftEdge.exe"
|
2015-11-18 22:10:07 +01:00
|
|
|
arrBrowserProcesses(7)="FreeStudioManager.exe"
|
2015-11-18 21:44:14 +01:00
|
|
|
|
|
|
|
Set wmiSvc = GetObject("winmgmts:\\.\root\cimv2")
|
|
|
|
For i = 0 To UBound(arrBrowserProcesses)
|
|
|
|
wql = "SELECT * FROM Win32_Process WHERE Name='" & arrBrowserProcesses(i) & "'"
|
|
|
|
Set processes = wmiSvc.ExecQuery(wql)
|
|
|
|
Do While processes.Count > 0
|
|
|
|
For Each process In processes
|
|
|
|
process.Terminate
|
|
|
|
Next
|
|
|
|
WScript.Sleep 200
|
|
|
|
Set processes = wmiSvc.ExecQuery(wql)
|
|
|
|
Loop
|
|
|
|
Next
|
|
|
|
|
|
|
|
End Sub
|
|
|
|
|