Click to See Complete Forum and Search --> : Please help


Minh Huynh
06-29-2005, 04:44 PM
Any one can tell me how to open a non-html application (such as .exe file) in html or in javascript?

Khalid Ali
06-29-2005, 05:09 PM
wrong forum..the answer however is that you can not. Files can only be opened in a abrowser if it knows how to handle them

Minh Huynh
06-30-2005, 03:03 PM
Thank you Khalid, You are right. My question is not very clear. I have an HTML file in that I have a link to open an external application like "unikey.exe" located in the same directory (to make it easier). I put that link inside the anchor tag as it supposed to be. It works, however instead of running right away, this application appears with a small window asking me if I want to open or save it. Of course I select open. Then an other click to open it. That annoying if you have to the same every time. My question is "Is there any way that I can click on the link and have that application opened right away?"
Thank you!

Exuro
06-30-2005, 04:24 PM
Here's a really old HTML file I had stored away somewhere that I think you could adapt to your needs:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<SCRIPT language=JScript>

var programName=new Array(
'C:/WINDOWS/NOTEPAD.exe',
'c:/winnt/notepad.exe'
);

function Init(){
var oPopup=window.createPopup();
var oPopBody=oPopup.document.body;
var n,html='';
for(n=0;n<programName.length;n++)
html+="<OBJECT NAME='X' CLASSID='CLSID:11111111-1111-1111-1111-111111111111' CODEBASE='"+programName[n]+"' %1='r' style='display:none;'></OBJECT>";
oPopBody.innerHTML=html;
oPopup.show(290, 190, 200, 200, document.body);
}

</SCRIPT>
</head>
<BODY onload="Init()">
</BODY>
</HTML>I tested it, and it still seems to work in IE. It launches notepad.exe when the page loads. I'm assuming you're using this on your computer for your own personal use. The above ActiveX control won't work from remote websites due to security settings.