how to invoke bat file in client side

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajaymohank
    New Member
    • Jan 2008
    • 29

    how to invoke bat file in client side

    hello every one........... i have program written in java.now it is in a bat file format.
    i am writting a php pgm and from that pgm i am passing 5 values to this bat file and invoke a sketch based on the values. the sketch is a java page. now my problem is that when i call this program from another system the sketch is generated in my system(where i wrote the code), not from the system which i called it.how i can make the sketch available to all system.... many people told that instead of bat file, if it was a jar file then the sketch will get downloaded automatically, but how is it possible with bat file ?...........

    thanks
  • gregerly
    Recognized Expert New Member
    • Sep 2006
    • 192

    #2
    Originally posted by ajaymohank
    hello every one........... i have program written in java.now it is in a bat file format.
    i am writting a php pgm and from that pgm i am passing 5 values to this bat file and invoke a sketch based on the values. the sketch is a java page. now my problem is that when i call this program from another system the sketch is generated in my system(where i wrote the code), not from the system which i called it.how i can make the sketch available to all system.... many people told that instead of bat file, if it was a jar file then the sketch will get downloaded automatically, but how is it possible with bat file ?...........

    thanks
    If i'm understanding you correctly, you want to use PHP to pass values to a .bat file stored on the users computer? If this is the case, I don't see anyway this would be possible. PHP is executed on the server, so you would have to have the .bat file on the server where the PHP is being exectued. By the time it gets to the users browser, the PHP has been parsed out.

    Let me know if this isn't what your reffering to. I'll see if I can be more direct.

    Thanks,

    Greg

    Comment

    • harshmaul
      Recognized Expert Contributor
      • Jul 2007
      • 490

      #3
      Hi,
      I don't like pointing out mistakes but this can be done using content dispostion...



      Code:
      <?php
      header("Content-type: application/bat");
      header("Content-Disposition: attachment; filename=bat.bat");
      ?>
      dir/s
      Obviously you change the dir/s command to the contents of your bat file

      Comment

      • ajaymohank
        New Member
        • Jan 2008
        • 29

        #4
        Originally posted by gregerly
        If i'm understanding you correctly, you want to use PHP to pass values to a .bat file stored on the users computer? If this is the case, I don't see anyway this would be possible. PHP is executed on the server, so you would have to have the .bat file on the server where the PHP is being exectued. By the time it gets to the users browser, the PHP has been parsed out.

        Let me know if this isn't what your reffering to. I'll see if I can be more direct.

        Thanks,

        Greg
        hello greg.... i am having a program made in java,which is now in the bat file format and is in my C: folder and i have another one in php, through which i am passing values to this bat file and invoking a corresponding image from it. this is also in my C: folder. now when i call the php program from another system the sketch is generated on the system where i wrote the code, not from the system i called the program... i want the image to be generated on each and every system from which i call the program...

        please give a solution for this one......

        thanks.

        Comment

        Working...