/    Sign up×
Community /Pin to ProfileBookmark

How to run exe file using JavaScript

Hi,

How to run exe file using JavaScript in IE and Firefox browsers.

Please send procedure for this.

Thanks in Advance,
kumar

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@DmitriFApr 10.2008 — you cant
Copy linkTweet thisAlerts:
@felgallApr 10.2008 — Fortunately it is not allowed or you'd have viruses running straight onto your computer every time you visited the web.
Copy linkTweet thisAlerts:
@kumar_cauthorApr 10.2008 — Our application is for internal purpose.

In case of IE, I am able to run exe file using [B]ActiveXObject[/B]

But, In firefox, I am not able to run using [B]ActiveXObject[/B]

Is there any other way to run exe file in firefox.

Thanks in Adnace
Copy linkTweet thisAlerts:
@toicontienApr 10.2008 — No, you cannot run an executable file automatically in Firefox. Real web browsers (excluding Internet Explorer) do not allow arbitrary executable files to run due to security issues, as mentioned before. I wonder if you could program a small Java applet that loads the EXE file instead? Maybe what you want to accomplish would be best implemented in Java?
Copy linkTweet thisAlerts:
@slaughtersApr 10.2008 — Or simply tell the users to save the exe then click on the "run" link in the Firefox download window.
Copy linkTweet thisAlerts:
@MaheadamsAug 02.2011 — No, you cannot run an executable file automatically in Firefox. Real web browsers (excluding Internet Explorer) do not allow arbitrary executable files to run due to security issues, as mentioned before. I wonder if you could program a small Java applet that loads the EXE file instead? Maybe what you want to accomplish would be best implemented in Java?[/QUOTE]

No, We can able to launch exe file in mozilla also., before that we need to configure security.?

--

Thank you

Maheadams
Copy linkTweet thisAlerts:
@rnd_meAug 02.2011 — i don't know what everyone is tralking about when they say you can't.

you cannot execute a specific exe by name, but you can "run" it from javascript in that you can start the exe. the limit is that arguments are a little janky, and you don't get a exit status code without further complication.

simply associate the exe with a made-up mime type, and open that mimetype to spawn the exe on-demand.

for example. run this in the firebug console:
[CODE]window.open("data:x-application/myapp;,12345");[/CODE]
you then browse to the exe you want to run, and remember to "do this automatically from now on"...

now, every time you run the snip, the exe you selected will execute.


if you want to talk back to js, you need to write to a file using jsonp format and inject a script tag pointing to the local path in your document. i know this works in firefox, not usre about other browsers.

firefox will also take the data you pass in the window.open() call and store it in a temp file. the path of that temp file is passed as the sole argument to your exe. keep that in mind if your exe behaves unexpectedly. for example, if i choose notepad in the save/open dialog resulting from the above code, it will show "12345" in notepad when it opens because i called notepad with an argument of the temp file path. note the actual filename is random and unpredictable...
Copy linkTweet thisAlerts:
@jalarieAug 02.2011 — Put the .exe in a .bat file and point the link to that batch file. Works great in every browser that I know of.
×

Success!

Help @kumar_c spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...