Using this very simple straight foreword vbscript, you can cycle through all currently running processes and kill the one you name below.
This can be handy if you have an application/instance which has become non responsive, such as IE when loading flash based pages maybe…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\" & strComputer & "rootcimv2") Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'iexplore.exe'") resp = msgbox("All internet explorer windows must be closed in order to continue" & vbCrLf & "Click Yes to close them now or No to cancel", vbYesNo) For Each objProcess in colProcessList If resp = vbNo Then 'Nothing To do Else objProcess.Terminate() End If Next |