frankjin
Posts: 18
Joined: Tue Nov 23, 2010 11:11 pm

running batch file in backgound

Hi Support,

I got batch file running through custom actions as part of the install package, but the problem is the DOS window always pop up when the batch file runs and the risk is the DOS window could be terminated manaually during the install, is there any way to run the batch file in background?

Regards,
Frank.
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: running batch file in backgound

Hello Frank,

You can use the following script to run a BAT file without the cmd window:

Code: Select all

const WindowStyleStealth  = &H20000000
set WSO = createobject("WScript.Shell")
WSO.run "%comspec% /c sample.bat", WindowStyleStealth, false 
where "sample.bat" is your BAT file.

Regards,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
frankjin
Posts: 18
Joined: Tue Nov 23, 2010 11:11 pm

Re: running batch file in backgound

thanks, it worked.

Return to “Common Problems”