1

How can I execute a .bat file directly from webpage written in HTML format?

(This question was originally tagged with [java].)

2
  • 2
    what does this have to do with java? Commented Feb 10, 2011 at 12:11
  • I sincerely hope (and pretty strongly believe) that it is IMPOSSIBLE Commented Feb 10, 2011 at 12:15

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thankx, I hava done it indirectly, by opening the dialogbox containing the .bat file n then executing it from there with the help of javascript.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.