Visual Kill -9
Here is some Visual Basic script code which allows you to terminate a process given a process id number.
' Kills a program given its process id.
Function ProgKill(strProcessId)
' Declare used variables
Dim strWQL
Dim objProcess
Dim objResult
Dim intReturnCode
Dim wmi
Set wmi = GetObject("winmgmts:")
' Get Process by WMI
strWQL = _
"select * from win32_process where ProcessId='" _
& strProcessId & "'"
Set objResult = wmi.ExecQuery(strWQL)
' Kill all found process
For Each objProcess in objResult
' Try to kill the process
intReturnCode = objProcess.Terminate(0)
Next
End Function
You can use code like this to kill a process started in your script after a given event or set time.