4 Replies Latest reply on Oct 26, 2007 5:53 PM by rupang

    Running *.bat file from JBoss 4 Web Server

    rupang

      Hello,
      I need to run a *.bat file from a URL on the JBoss-4.0.5.GA Server.

      The Scenario is: When I click on the Link on the page it runs a javascript function which has a call to my.bat file as follows

      window.location = "/MyApp/exe/install.bat";

      Now when we click on the link it should open a Dialog Box "File Download-Security Warning" and it has 3 buttons "Run", "Save" and "Cancel"

      The Probelm is I am not getting that Dialog Box at all. Instead its directly writing the content of the bat file on the browser window!

      Thanks for the help!
      Regards
      Rupang

        • 1. Re: Running *.bat file from JBoss 4 Web Server
          peterj

          Try adding the following mime type to the list at the end of server/default/deploy/jbossweb-tomcat55.sar/conf/web.xml:

          <mime-mapping>
           <extension>bat</extension>
           <mime-type>application/octet-stream</mime-type>
           </mime-mapping>



          • 2. Re: Running *.bat file from JBoss 4 Web Server
            rupang

            I added the "bat" mime type in the Web.xml at that location. and restarted/re-published the JBoss/ Application. It still displays the .bat file content in the Browser window!

            Do I have to follow any specific steps to make sure that the modified web.xml is in effect!

            I verified that the App.war file was updated with current time stemp, so system did proper cleanup while publishing the web app.

            Thanks
            Rupang

            • 3. Re: Running *.bat file from JBoss 4 Web Server
              peterj

              I think you are running into a browser caching problem. Either update the timestamp on your bat file and then refresh the browser, or try another bat file.

              • 4. Re: Running *.bat file from JBoss 4 Web Server
                rupang

                Hey Peter, Thank you so much! It worked for me!

                I just renamed the bat file and redeploy and restert the borwser and it worked.

                Also I placed the mime type tag in our Application's WEB-INF/web.xml file rather than the tomcat's web.xml. So it will work out of the box even on those jboss server which does not have this setting.

                Thanks Again!
                Regards
                Rupang