I tried to open a program using this code:
<head>
<title></title>
&l开发者_如何学编程t;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?
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.
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
Check your browsers' configuration, it may block ActiveX.
Do you get any error message ?
精彩评论