John Walts
John Walts

Reputation: 11

I want to open a program by JavaScript on the clients computer? (WScript.shell)

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?

Upvotes: 0

Views: 1083

Answers (3)

bevacqua
bevacqua

Reputation: 48566

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

Upvotes: 1

Thibault Witzig
Thibault Witzig

Reputation: 2200

Check your browsers' configuration, it may block ActiveX.

Do you get any error message ?

Upvotes: 0

Alexander Beletsky
Alexander Beletsky

Reputation: 19841

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.

Upvotes: 1

Related Questions