Vijay
Vijay

Reputation: 133

How to execute .bat file without opening console window using wix custiom action

Am executing .bat file in custom action using wix. When i run the set up it successfully exceuting .bat file but with console window. I don't want any console window. It is possibe to hide window using wix or with .bat file.

Thanks in Advance

Upvotes: 2

Views: 681

Answers (2)

Bidden1
Bidden1

Reputation: 1

  1. Create a new text file with a .vbs extension, for example, run_invisible.vbs.
  2. Open the .vbs file with a text editor and add the following code:

Set objShell = CreateObject("WScript.Shell") objShell.Run "Your_bat_file_path", 0, True Replace "your_batch_file.bat" with the path to your actual batch file.

  1. Save the .vbs file.
  2. now you can double click the .vbs file(not the .bat file) to run your batch file without displaying the console window.

Upvotes: 0

Martin Dinov
Martin Dinov

Reputation: 8825

You can do:

start program args
exit

but this will open command line window for just a moment, until the program starts, afterwhich it closes. Alternatively, and equivalently, you can do:

Start ""  "program args"

So, to start notepad and then exit the cmd terminal, you'd do:

start notepad
exit

or:

Start "" "notepad"

Upvotes: 0

Related Questions