Discussion Locked

Executing an EXE File in HTML

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I like to execute an EXE(*.exe) file from a HTML page. If I want to use Java Script to execute the EXE file from a HTML page, what's the code.

9 replies

by ebob

Sorry, there is no JavaScript that will perform this.

You could try a simple link:

Run This

but I believe the functioning of this will depend to at least some extent on the setup of the user's Browser.

by chinmoy_b

The link Run This is OK. This link generally starts to download the EXE file. But I want to execute the EXE file. What's the simple solution.

by ebob

Since the behaviour of a simple link (as in my previous response) is browser dependent, you need to look at providing a solution on the server, itself.

That is to say: there is no "simple" solution.

But a quick little CGI (written in Perl, forexample) that calls the executable would definitely work. You might also be able to reconfigure your server to run the executable. The details depend on what server you're using. Both of these also require that you have access to run executables from your website.

by ebob

Going back to your question: there is no Javascript to do what you want.

by pratibha.malhotra

U can definatly execute an exe from java code...u can always embed java code in html...

Use exec() of java.lang.Runtime class to execute any exe namely notepad....
This method will execute the specified string command in a separate process...in case u want code ::

Runtime r = Runtime.getRuntime();
r.exec("Notepad");

by pratibha.malhotra

note ::
I had forgot to mention entire path in exec()
r.exec("C:\WINNT\Notepad");
(sssuming u r working on NT/2000)

pratibha malhotra

This discussion is closed to new replies.