Forum Moderators: phranque
I am building in internal (so security is not an issue) intranet application and part of the project is to allow users to run .exe files from a browser. The browser is on a machine dedicated as an access point to the intranet and the exe is on this machine.
Ideally I would like to launch the .exe using JavaScript (don't ask!), but I would like the exe to open automatically, without the usual "Run from it's Current Location"..."Save As" alert box being opened.
Is this possible?
Thanks a million in advance!
Cross posted to Browsers, HTML, and Page Design
Not outside of using an ActiveX component, that is. You might find:
[whirlywiryweb.com...]
helpful. Or maybe not.
Note that I am only a javascript apprentice, so I could easily be wrong.
Thanks for the reply! Here is the solution I eventually went with:
Since it's an intranet and since we're using at least IE 5.01, I made use of HTML Applications. Once we get past the initial trusting of the hta we should be fine. Here's a little code segment that I just put together that launches notepad from a button on a web page. Just save it as a .hta file and it should run in IE via the HTML Application host.
<html>
<head>
<title>Notepad Launch</title>
<HTA:APPLICATION ID="AppRunner"
APPLICATIONNAME="AppRunner"
WINDOWSTATE="normal"><script language=JScript>
function notepad()
{
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run("notepad.exe", 1, true);
}</script>
</head><body>
<form>
<input type="button" value="Notepad" onclick="notepad()">
</form>
</body>
</html>
Now, however, the client says that the exe's are on the intranet server.... Thors, I think that your link may come in very useful here.
Thanks again!