Link to home
Start Free TrialLog in
Avatar of Jeremy Daley
Jeremy DaleyFlag for United States of America

asked on

Open .exe from Javascript

i have an image that looks like a clock located as a link on my webpage. when you click on it, i want one of my companie's internal programs to open.

the .exe is located on our network drive so i need to put a full path for the .exe location. i'm pretty novice with javascript but i want something like (pseudo-code):

<a href="javascript:program.open('F:\timecard.exe')"><img src="timecard.jpg"></a>

thanks,
jeremy
Avatar of proziath
proziath

The closest I think you can get is something like the following:

<a href="javascript:window.open('F:\\timecard.exe')"><img src="timecard.jpg"></a>

You will get a message warning of the dangers of running a program from a web page. Javascript has a built in security measure to prevent the automatic running of programs without notifying the user first because this could pose a danger when used maliciously.
Avatar of Jeremy Daley

ASKER

it doesn't exactly have to use the coding <a href...>

if there is any way to do it, i'll use that way...i'm just using an example. if there is some kind of shellexecute code that works with javascript that would be useful too. there's gotta be another way that's not going to bring up that message window...
This may be of interest to you, I'm not sure if it applies, I don't know how your webpage is hosted and stuff like that but here's a link you may want to take a look at:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/hta/overview/htaoverview.asp
Are you Trying to open it on the server computer or the  visitor comuter?
Opps answerd my own question. I think that you would have to make your own popup window that propmpts you, if they click yes it loads it and if no then it doesnt.

If you want it to load from your server to someone out of the network youll have to use "virtual directory's". But then they will have the option to save or open.
here's the complete story....our company is using active desktop on all employee computers to display collector performace (for a debt collection agency) and to have other stuff displayed as well. one problem is, some computers have too many icons on the desktop already that they cover the page. there's ways around this, but we were planning to make icons on the .aspx page that is shown on active desktop. these .exe files exist on a server and they are only used within the agency, so there's no need for security.

it seems like the only way we can do it is by having that frickin' dialog box show up saying "open [] save" ... and i don't want this

deathbob, if you have some code example of how i could just open up an .exe without any prompts, that would be awesome, but i could just use regular html if i wasn't worried about any prompts at all.

help me !!!
:)

thanks again,
jeremy
Little Harder. I was going to say if it was to execute on the server use some CGI, but like that the best i can say is youll have to put up with the window.  This is really gonna bug me now...
well, i'm starting to think more and more that it is impossible to open without first getting the prompt. it's most likely an issue with internet explorer that won't let it happen on grounds of security reasons.

it's strange though, because some damn website ad maliciously put an icon on my desktop without me knowing it until i saw it. i was pretty angry and called the company and the guy acted like they never did such a thing.

if you never find the answer, i may just give you the points for persistence...it's appreciated
later,
jeremy
ASKER CERTIFIED SOLUTION
Avatar of Deathbob
Deathbob

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
neither one is really more of a risk, just the fact that anyone could start your programs if they wanted to without YOU wanting to. which i guess is understandable, but in terms of my situation, i wish there was an exeption because an "in-house" application doesn't really have security issues since it's only used by people within the company.

well, i'm suppose to be getting a couple of refunds on some other questions, but i appreciate your interest in helping. thanks,
jeremy