cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Argument through batch script?

Hi All,

How can we pass a argument through CMD batch script?

Launching a exe but also have to pass argument as well.
(1) Reply
For EXE ( Type 2 ) custom actions, just setup the filename and command line in InstallShield:

Example:

WorkingDirectory:INSTALLDIR
FileName & Command Line: CMD /C "MYBAT.BAT RED BLUE"

then in side the bat file %1 will = RED and %2 will = BLUE. Careful to escape arguments that have spaces.

As an aside, you might want to consider if there is a better way then calling a batch file to do what you need. For example I often see people write batch files that run "net start myservice" instead of properly authoring the ServiceControl table.