views:

251

answers:

3

hi..

I wrote a javascript function in my html page to execute an .exe file. for this i used ActiveXObject. my function is:

//~~~~~~~~~~~~~~~~~~~~~~~~~~~JavaScript~~~~~~~~~~~~~~~~

function openWin(url)
 {

  if (!document.all) {
         alert ("Available only with Internet Explorer.");
     return;
   }


var ws = new ActiveXObject("WScript.Shell");
ws.Exec(url);
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It works fine but there is a alert "An ActiveX control might be unsafe to interact with other parts of the page. Do you want to allow this interaction?" comes up to confirm. If i say YES only it will get loaded.

Pls anyone help me on this how to avoid this pop-up coming every time when i reload my html page.

A: 

You should enable activeX in Internet explorer security settings.

http://www.nrc.gov/reading-rm/adams/install/enabling-active-x.html

If you want your users to not seeing this message, then they should enable it. But you can't force them to do it because of security issues.

uthark
thank you for your reply. But already my IE browser setting are the same. :-(
shan.swf
+2  A: 

You can't. Your users can, by giving your page trusted access to their computer (e.g., by adding the URL to the "Trusted Sites" zone).

T.J. Crowder
+1. The only reason I can think you would want to `Exec` a url is to have it open in the default browser which might not necessarily be the one in use.
Andy E
Am trying to load a flash exe file from my html page. Exe is located in a remote path.
shan.swf
exe will load separately not inside the browser or any new window. it will load independently.
shan.swf
@shan: executing a url is the same as typing a url in your default browser. The same effect would be given by just providing a direct link to the file. Even a flash exe would not execute automatically, the user would be presented with a file download box instead. Your only options are to either embed the flash movie into a web page or ask your users to download and open the file.
Andy E
i tested this in my local machine by giving the path of an exe file which is in my local system. same pop-up appearing.
shan.swf
@shan: You'll need to adjust the security settings for the zone your browser thinks your page is in (hopefully Trusted Sites or Intranet) to allow ActiveX without warnings.
T.J. Crowder
A: 

Is there anyway to do this without altering the client's settings? By some certificate for instance?

PCastro