0

I tried to open a program using this code:

<head>
<title></title>
<script language="javascript" type="text/javascript">
    function run() {
        var shell = new ActiveXObject("WScript.shell");
        if (shell) {
            shell.run('"C:\\Program Files (x86)\\BitTorrent\\BitTorrent.exe"', 1);
        }
        else
        { alert("BitTorrent is not installed on your system."); }
    }
</script>
</head>
<body onload="run()">

</body>
</html>

But it doesn't work. Any help, please?

6
  • 5
    Internet would be a really scary place if that would be possible to do that easy. Commented Dec 14, 2010 at 14:32
  • Ideally you would develop a browser plugin for this Commented Dec 14, 2010 at 14:34
  • 1
    I like how BitTorrent isn't installed in yoru system if ActiveX fails to instantiate WScript.shell Commented Dec 14, 2010 at 14:47
  • @Max: Starting local applications is pretty easy when done right. Ever used Skype, Spotify, iTunes, Telnet or any other tool using a custom protocol handler that is not handled by the browser itself? Commented Dec 14, 2010 at 15:49
  • @0xA3: Yes, the only difference is that all of that examples you gave require user to manually install something beforehand. Commented Dec 14, 2010 at 17:05

3 Answers 3

1

It is because browser block creation of ActiveX controls, for security reasons. Moreover, ActiveX is supported only in IE; IE has options to allow run ActiveX in browser, but I have doubts that many users have this feature enabled.

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

Comments

1

Why would you want to open BitTorrent anyways? I believe you can achieve the desired effect using magnet links

PD: Check their developers page

Update: I'm not sure if this is "legal" here, or considered "spam", if it easy please remove it, but here's a link to a site that implements magnet links to achieve what I think you might want to be doing: eztv.it. Check their magnet links

Comments

0

Check your browsers' configuration, it may block ActiveX.

Do you get any error message ?

1 Comment

No I don't get any errors, it is just a blank page. I am using Mozilla Firefox.

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.