By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,890 Members | 1,050 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,890 IT Pros & Developers. It's quick & easy.

how to invoke bat file in client side

P: 29
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
Feb 15 '08 #1
Share this Question
Share on Google+
3 Replies


gregerly
Expert 100+
P: 192
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
Feb 15 '08 #2

harshmaul
Expert 100+
P: 490
Hi,
I don't like pointing out mistakes but this can be done using content dispostion...
http://www.codersadvocate.com/blogs/...sposition_PHP/


Expand|Select|Wrap|Line Numbers
  1. <?php
  2. header("Content-type: application/bat");
  3. header("Content-Disposition: attachment; filename=bat.bat");
  4. ?>
  5. dir/s
Obviously you change the dir/s command to the contents of your bat file
Feb 15 '08 #3

P: 29
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.
Feb 16 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.