1 Reply Latest reply on Jun 22, 2015 7:56 AM by cwinning

    Propatch file not running. bat file running powershell


      I am trying to execute a bat file which loads a powershell script. But its not working.


      If you run the run.bat file it will install on the PC


      As you can see by the image below it has pushed all the files and shavlik has created its own.


      If you run the shavlik bat file that get created by shavlik,  that script works but it just does not run on its own ?


      I have used the custom action to install .exe and for other bat files with no problem, but do I have to do something different to run powershell in a bat file ?


      Please help.





        • 1. Re: Propatch file not running. bat file running powershell
          cwinning CommunityTeam


          All Custom Action jobs run/initiate as the System account and running the batch by hand would use the currently logged user.  That could be the issue.  You could open a CMD prompt as the System account and then run the Shavlik batch file, whether it works or not will help point us in the correct direction.


          To Run a Command Prompt as Local system use the following steps:

          1. Download Psexec.exe.

          2. Open a new CMD window as an administrator.

          3. Navigate to the folder that contains psexec.exe

          4. Run this command:

            psexec.exe -i -s cmd.exe

          5. A new CMD prompt will pop up running as the System accont.

          6. Run the Shavlik batch file.


          Does it complete?

          If it does, I'm going to need screenshots of the Custom Action setup and possible the contents of you batch file minus any password in it.