2

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.

2
  • Why do you want to Exec a url? Why not use window.open? The only use I can think of for using Exec on a url is to open it in the user's default browser, which seems like an odd thing to do from a web page. Commented Feb 4, 2010 at 12:46
  • hi Andy : window.open will create new Tab. Am not loading my exe into browser. exe will load independently. Commented Feb 4, 2010 at 13:21

2 Answers 2

3

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).

Sign up to request clarification or add additional context in comments.

6 Comments

+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.
Am trying to load a flash exe file from my html page. Exe is located in a remote path.
exe will load separately not inside the browser or any new window. it will load independently.
@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.
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.
|
0

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.

1 Comment

thank you for your reply. But already my IE browser setting are the same. :-(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.