View Full Version : Execute DOS command from Custom Action

05-19-2005, 12:39 PM
What is the best way to call a DOS command from a Custom Action? I tried putting the command in a .bat file but InstallShield requires that it is put in an EXE. Is there another way without having to package it in VB executable?


05-19-2005, 02:00 PM
What is it that you are trying to do. Most, if not all, of the actions that can be performed with a DOS command have a corresponding function call.

05-19-2005, 02:09 PM
Yes, everything I need is pretty much has a corresponding function except for couple of things. This InstallScript needs to remove an existing application that wasn't install with this script. So, I need to:

1. Kill the process currently running :
taskkill /IM MyProcess.exe
2. Unregister an old dll
regsvr32 -u MyOldDLL.dll

Also, this install needs to run sliently so I can't ask the user to shut down the existing app. It runs when they sync their laptops to the corporate office.


05-20-2005, 09:05 AM
Can you just use LaunchAppAndWait(WINSYSDIR^"taskkill.exe", "args", LAAW_OPTION_WAIT)? Since taskkill.exe and regsvr32.exe are standalone executables, there's no need to go through a batch file...