how would I run a custom action with taskkill.exe to kill ms runtime c++ process during the uninstall of an app
no sure about how to sequence this
am using wise - execute program from destination
0 Comments   [ + ] Show Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.


I'd be using a VB Script with WMI calls. Here's one I found in my arsenal (not used personally):

'* Script Name: StopProcess.vbs
'* Description: Checks for running process and stops it.
Option Explicit


Dim objWsh
Dim strProcessName

strProcessName = "ProcessName.exe"

Set objWsh = CreateObject("WScript.Shell")


fnStopProcess objWsh, strProcessName

Set objWsh = Nothing


Function fnStopProcess (objWsh, strProcessName)

Dim objProcess
Dim objWMIService
Dim colProcessList
Dim strSql
Dim blnProcessRunning

'Initialise boolean
blnProcessRunning = False

'Obtain WMI Service
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")

'Build query
strSql = "Select * from Win32_Process Where Name = '" & strProcessName & "'"
Set colProcessList = objWMIService.ExecQuery(strSql)

For Each objProcess In colProcessList
'Process found - stop it
blnProcessRunning = True

Set objProcess = Nothing
Set colProcessList = Nothing
Set objWMIService = Nothing

End Function
Answered 10/15/2007 by: VBScab
Red Belt

Please log in to comment
thanks a lot vbscab your script works 100 and 1 percent

cheers for that
Answered 10/15/2007 by: cygan
Fifth Degree Brown Belt

Please log in to comment
Answer this question or Comment on this question for clarity