Execute a batch file from HTML page
How can I execute a .bat file directly f开发者_开发技巧rom webpage written in HTML format?
(This question was originally tagged with [java].)
It's unclear what you want to do, but it sounds to me like it's impossible.
If you want the .bat file to be executed on the server on which the web page is hosted, then you can't solve it using plain old HTML. You need a scripting language like PHP or similar.
If you want to execute the .bat file on the client, that is, on the host running the browser, it is definitely impossible. (Imagine the consequences if any random site could start executing system-commands on your computer.)
Since you've tagged it with Java, I'll assume you had some sort of Java-applet (or perhaps javascript) solution in mind. This doesn't change anything. Both applets and scripts are executed in a sandboxed environment, and there is no way you can execute .bat files using these techniques.
精彩评论