| 1 | ' Based on: Process.vbs by Guy Thomas http://computerperformance.co.uk/
|
|---|
| 2 | ' -------------------------------------------------------'
|
|---|
| 3 | Option Explicit
|
|---|
| 4 | Dim objWMIService, objProcess, colProcess, strComputer, strList, objShell
|
|---|
| 5 | strComputer = "."
|
|---|
| 6 |
|
|---|
| 7 | Set objWMIService = GetObject("winmgmts:" _
|
|---|
| 8 | & "{impersonationLevel=impersonate}!\\" _
|
|---|
| 9 | & strComputer & "\root\cimv2")
|
|---|
| 10 |
|
|---|
| 11 | Set colProcess = objWMIService.ExecQuery _
|
|---|
| 12 | ("Select * from Win32_Process")
|
|---|
| 13 |
|
|---|
| 14 | For Each objProcess in colProcess
|
|---|
| 15 | If objProcess.name = "VBoxTray.exe" Then objProcess.terminate
|
|---|
| 16 | Next
|
|---|
| 17 |
|
|---|
| 18 | ' Restart
|
|---|
| 19 | Set objShell = CreateObject("Shell.Application")
|
|---|
| 20 | objShell.ShellExecute "VBoxTray.exe", "", "", "open", 1
|
|---|
| 21 |
|
|---|
| 22 | WScript.Quit
|
|---|
| 23 |
|
|---|