4 Replies Latest reply on Oct 22, 2015 5:55 PM by kellytice

    Batch File Question With Exe

    jhungerford8887

      I have a bat file that is pointing to a txt file with parameters to use for installing the exe.  If I put the bat file in "Before Applying Package" after a little bit the exe kicks in and starts installing.  I would like the bat file install to do all the install and configuring with the parameters.  Is there anyway to do this or another way I could just have this bat file do the install?

       

      Capture.PNG

        • Re: Batch File Question With Exe
          jbaits

          I have managed to get batch files working by setting them as a pre-install command and using a dummy executable as the main exe. Be sure to tell package boot to exit out if the batch command fails otherwise you will always receive a success even if the package install fails.

            • Re: Batch File Question With Exe
              jhungerford8887

              When you say dummy executable, did you put something other as the exe instead and also attach the exe you wanted to have the bat file from to the same package?

              • Re: Batch File Question With Exe
                kellytice

                You can use Packageboot to “Run a program” as a “Before Applying Package” or "After Applying Package" option. 


                For the Program Name you would call cscript.exe (which is a file that will already be on the Windows box) and then on the command line parameters box you would specify the name of the .BAT or .VBS that you want to run along with any other needed command line switches.

                 

                Here’s an example Package Boot Editor page of a package that can execute a script as a post-execution task:

                • In the “Program name” field, we have:            CSCRIPT.EXE
                • In the “Command-line parameters” field, we have:        //B //Nologo MyBatchFile.BAT

                (the //B //Nologo options there are cscript options; you probably DO want to include those as may suppress messages which might pop up & the logo)
                cscript.png

                Important:  You’ll also need to include the script file in the package by adding it in the “Include additional files with the package” dialog (which is the option directly below the PackageBoot option on the Select Package dialog in the Edit Package wizard).