I'm applying a transform on a vendor msi for the installation using wise package stuido 8. This application creates a task in the start up. Before the application can be uninstalled, that task needs to be killed. The command line to kill that task is "taskkill /IM Alertwatch.exe  My question is, where in my transform can I include that command line for it to launch during uninstall.  Thanks and I appreciate any help.

Answer Summary:
Stop the service first through service control table and the specify custom action to kill the process.
0 Comments   [ - ] Hide Comments


Please log in to comment

Answer this question or Comment on this question for clarity



1. Stage it before "Remove files" Sequence in installexecute sequence table.

2. You can also stage it before installfinalize.

Use the below condition to run the custom action during uninstall only.

If REMOVE~="All" then

Taskkill.exe /IM Alertwatch.exe



1. Killing the process before the files uninstallation will free the file if it in use.


2. before installfinalize: if the file is in use, windows installer will not uninstall it, instead it will add it to pending files actions and the file gets removed when the user reboots his machine next time. This will leave the directory on the machine where file was located.

Answered 06/13/2012 by: Propac
White Belt

Please log in to comment

Using the Taskkill.exe /IM Alertwatch.exe command directly to kill process in custom action during uninstallation/installation prompts a command prompt when it is executing this command line.. Some process takes more time to terminate itself, So, it is always better to use VBScript to do these type of stuffs. So It wont distrub the end users by prompting a command prompt at the time of uninstallation.

Answered 06/14/2012 by: jagadeish
Red Belt

Please log in to comment

I will make your work easy. :)

Use the script here:


Create a Customa Action and place it just after InstallFinalize and Run it in Deffered execution in System Context. Put condition as REMOVE~="ALL"

Answered 06/15/2012 by: piyushnasa
Red Belt

Please log in to comment

Killing a process should be the last option. You can stop the service related to this process using the service control table. In case it fails create a custom action and use the pskill.exe from microsoft sys-internals to kill the process.

Answered 06/13/2012 by: adilrathore
Fourth Degree Black Belt

Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja