Discussion Locked

JavaScript

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to embed a script in an html file that launches and exe.
How do I do that?

5 replies

by jay eckles

Well, embedding a script in an HTML file is the easy part...

for example. However, you'll have to provide more detail about what you're trying to do when you say"launch an .exe". If you want to launch an exe on the server, then you have several options, such as a CGI that launches the application, creating an OLE object on the server, etc. If you want to launch an application on the client, then you're pretty limited. You can try a link to where you think the application would be on the client computer, say c:\Program%20Files\winzip\winzip32.exe, for example. You can't access the client's file system with client-side scripting, so you can't seek out an exe. You probably can't just name the exe (Winzip probably won't work). Your best bet is probably to link to a document that would be associated with your target application on the client. For example, if you wantedto launch winzip on the client machine, provide a link to a zip file on the server.

A great place to go with questions about Javascript is http://developer.irt.org/script/script.htm.

Good luck.

Jay Eckles
www.jayeckles.com

by codebasher

If your users only use MS Windows clients using Internet Explorer you can use create a Windows Scripting Host shell.

If you know that the exe is mapped on the client you can call it by name like this:

If the exe isn't mapped but you know it's location then you can use that. (objWSH.run("NOTEPAD.EXE")
The only time I would recomend using this is if you are writing for anintranet where everyone uses the same client OS and browser.

This discussion is closed to new replies.