I have a java program which was created for users to download from our website (as a zip) and then run from their computer (after it's unzipped). The program runs a simple audio exercise.
Currently, the program has to be run by clicking a bat file (start.bat) which is located inside the folder which contains the whole program.
Soon, the program will have different versions, all with different bat files that have to be clicked to execute each version (all in one big folder). Instead of users having to find the different bat files, I thought it would be great to have one html page that opens up locally with links to all of the different bat files. So when a use clicks on the link, it executes the bat file from the html page.
I have some experience with html and php, but have no clue how to execute a bat file form a html page. Is there a script I need to make this work? Any suggestions greatly appreciated.
execute bat file from html page
Page 1 of 17 Replies - 7830 Views - Last Post: 25 March 2012 - 04:23 PM
Replies To: execute bat file from html page
#2
Re: execute bat file from html page
Posted 25 March 2012 - 12:36 PM
Has nothing to do with Java and if you think about an Applet, an Applet cannot access the local file system.
You would have better luck in the HTML forum
Howver, if you present your .ZIP in your .html file, the user can double click on it.
You would have better luck in the HTML forum
Howver, if you present your .ZIP in your .html file, the user can double click on it.
#3
Re: execute bat file from html page
Posted 25 March 2012 - 12:38 PM
Thank you. I just need to know how execute a bat file from a html page. Is there a way to move this topic to the html forum? Can I just repost the topic there?
#4
Re: execute bat file from html page
Posted 25 March 2012 - 01:26 PM
Er, can't you just use the URL markup?
<a href=start.bat>Start Me</a>
Just create a link for each batch file. You will be asked if you want to save or run the file when clicked though.
<a href=start.bat>Start Me</a>
Just create a link for each batch file. You will be asked if you want to save or run the file when clicked though.
This post has been edited by GunnerInc: 25 March 2012 - 01:27 PM
#5
Re: execute bat file from html page
Posted 25 March 2012 - 02:01 PM
#4 GunnerInc,
I tried that at first and when the link is clicked, it shows a text string on page:
This is why I posted this topic - in an attempt to find the correct way of getting the .bat to execute from a link or form submit button on a html (or php, etc) page
I tried that at first and when the link is clicked, it shows a text string on page:
java -classpath ./classes/;./resources/;./lib/jl1.0.1.jar;./lib/mp3spi1.9.5.jar;./lib/tritonus_share.jar org.123.lmp.234.345.456 "./audios" "./configs" 1.0
This is why I posted this topic - in an attempt to find the correct way of getting the .bat to execute from a link or form submit button on a html (or php, etc) page
#6
Re: execute bat file from html page
Posted 25 March 2012 - 04:04 PM
Maybe Java Web Start is what you want, but you should NOT be able to do what you're asking. That's a security nightmare (q.v., ActiveX).
#7
Re: execute bat file from html page
Posted 25 March 2012 - 04:12 PM
From my understanding of the OP, his users download a zip to their computer then unzip to a directory then his Java program gets started by using a batch file. Soon there will be many version with many batch files?
Why don't you just create a "Loader"? User runs this program and is presented with choices of which java program to start. Once selected, pass the correct params to the Java exe.
Why don't you just create a "Loader"? User runs this program and is presented with choices of which java program to start. Once selected, pass the correct params to the Java exe.
#8
Re: execute bat file from html page
Posted 25 March 2012 - 04:23 PM
GunnerInc - Yes, it would be something than is downloaded to the users computer first.
I was going with a simple html file (with php, or whatever else it needs) just because it seemed to be a simple approach. I have no experience with loaders and wouldn't know where to start. Although, if it's not that complicated, I do have some coding experience and might be able to figure it out - if I know where to start.
I was going with a simple html file (with php, or whatever else it needs) just because it seemed to be a simple approach. I have no experience with loaders and wouldn't know where to start. Although, if it's not that complicated, I do have some coding experience and might be able to figure it out - if I know where to start.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote







|