Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Custom Action for calling .cmd file

Updated: 21 May 2010 | 2 comments
Apppackaging's picture
0 6 Votes
Login to vote
This issue has been solved. See solution.

Hi,

I have a situation where I need to execute .cmd file during the installation of my Package.
I am using wise package studio  5.6
can anyone suggest me how to execute it using custom action?

Thank you,

discussion Filed Under:

Comments

Apppackaging's picture
16
Nov
2009
6 Votes 0
Login to vote

Solution: Custom Action for calling .cmd file or .bat file

To execute a .BAT file in a Windows Installer installation, you will have to use a custom action. Do the following:
  1. In the .WSI file, select View > MSI Script..
  2. In the Installation Sequence list, click the location in the sequence where you want to place the custom action.
  3. Double-click the Execute Program from Path custom action on the Custom tab. The Execute Program from Path dialog displays.
  4. Populate the Details tab as follows:
·         Name: Enter a name for the custom action.
·         Property: Enter %COMSPEC. This is the environment variable that holds the location of the cmd.exe program.
·         Command Line: Enter "/c <path to .BAT>\<batchfile.BAT>" (replacing the text in <> with the path and name of your batch file. Enclose the path and batch file name in double quotes. The /c switch closes the cmd.exe window after the batch file executes. To execute the batch file and keep the cmd.exe window open, enter /k instead. (This can be useful for debugging batch files.)
Note: The cmd.exe launches in the System directory by default. If your batch file exelcutes actions in another directory, you must explicitly account for that in the batch file. For example, to list the files in c:\mydir, add a line to the batch file that reads 'cd c:\mydir'.
  1. Click OK.

Hope this will help someone.........

Thank you,
Apppackaging.

EdT's picture
17
Nov
2009
0 Votes 0
Login to vote

Done to death

This question comes up so regularly that a simple search will throw up a variant of the solution you found for yourself. So keep the search engine in mind for future questions....;-)

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.