Sunday, February 19, 2017

How To Kill A Process With A VBS Script

VBS Script

This shows how you can use a vbs script to kill a process/task without windows task manager. Just replace the "firefox.exe" with any processes you want to kill.

VBS Script:

taskKill = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & taskKill & "\root\cimv2")

Set processlistFull= objWMIService.ExecQuery _
("Select * from Win32_Process Where name = 'firefox.exe'")

For Each killPro In processlistFull
killPro.Terminate()
Next>

or 

You can download the actual .vbs script here: KILLSCRIPT.vbs
 
Remember to save the file as a .vbs using Notepad or Notepad++

No comments:

Post a Comment