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

Hide cmd window

Hi,

I am using InstallScriptMSI project.
In the installation package, I have the requirement to add some applications to windows firewall. For that I use the following script

strCommandLine = " firewall add allowedprogram program = " + INSTALLDIR +"MyApp.exe name=MyApp mode=enable" ;
LaunchAppAndWait( "netsh.exe" , strCommandLine , LAAW_OPTION_WAIT||LAAW_OPTION_HIDDEN );

But during setup, I find a blank command window during the execution of the above script. What should I do to hide this command window?

Thanks in advance....
Labels (1)
0 Kudos
(3) Replies
Jithin
Level 3

This occurs not only during execution of netsh.exe, but also for the following scripts...

//Installing Loopback adapter
LaunchAppAndWait( "cscript.exe","//B LoopbackInstall.vbs", LAAW_OPTION_WAIT||LAAW_OPTION_HIDDEN);

//Configure installation package
LaunchAppAndWait( "cscript.exe" ,"//B Configure.js",LAAW_OPTION_WAIT||LAAW_OPTION_HIDDEN);
0 Kudos
DebbieL
Level 17

You may want to try LaunchApplication instead of LaunchAppAndWait, and use SW_HIDE for the nShowWindow parameter.
0 Kudos
esiemiat
Level 9

Try launching CMD.EXE with the /C switch instead of CSCRIPT which runs in a CMD window. I think this will fix your issue.
0 Kudos