<< Back to Script Library

Prompt to kill process

Prompt the end user for a permission to forcefully terminate a process running in their session.
Version: 1.0.1
Created: 2019-03-20
Modified: 2019-03-20
Creator: asafg
Downloads: 35
Tags: process resource consumption taskkill user experience
The Script Copy Script Copied to clipboard
dim sProcName

dim sPID 

dim iYesNo 

dim oShell

sProcName = WScript.Arguments.Item(0)

sPID = WScript.Arguments.Item(1)

iYesNo = msgbox("Your "& sProcName &" consumes excessive resources and may be interrupting the work of other users on this computer. Is it safe to abort it?",4,"ControlUp")
if iYesNo = 6 then
   Set oShell = CreateObject("WScript.Shell")
   oShell.Run "taskkill /PID "&sPID,0 , False
end if