如何使用javascript从chrome浏览器运行.exe? [英] How to run a .exe from chrome browser using javascript?

查看:1630
本文介绍了如何使用javascript从chrome浏览器运行.exe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我一直在尝试使用Java Script从浏览器运行exe。下面是我一直用于WindowsIE的代码。



var MyObject = new ActiveXObject(WScript.Shell)

函数RunExe()

{

MyObject.Run(file:/// C:/Program%20Files/EditPlus%203/editplus.exe);

}



任何人都可以告诉我如何使用Chrome / FireFox做任何相同的弹出窗口。我知道IE和其他人之间的基本区别是IE使用ActiveX而其他人使用NPAPI / runtime来安装插件。



任何建议都有帮助



谢谢

Rahul



我尝试过:



var MyObject = new ActiveXObject(WScript.Shell )

函数RunExe()

{

MyObject.Run(file:/// C:/ Program%20Files / EditPlus% 203 / editplus.exe);

}

Hi,
I have been trying to run an exe from a browser using Java Script. Below is the code I have been using for WindowsIE.

var MyObject = new ActiveXObject( "WScript.Shell" )
function RunExe()
{
MyObject.Run("file:///C:/Program%20Files/EditPlus%203/editplus.exe") ;
}

Can anyone tell me how to do the same using Chrome/FireFox with out any pop-ups. I know that the basic difference between IE and others is that IE uses ActiveX and others use NPAPI/runtime to install Plugins.

Any suggestions would help

Thanks
Rahul

What I have tried:

var MyObject = new ActiveXObject( "WScript.Shell" )
function RunExe()
{
MyObject.Run("file:///C:/Program%20Files/EditPlus%203/editplus.exe") ;
}

推荐答案

Quote:

如何使用javascript从chrome浏览器运行.exe?

How to run a .exe from chrome browser using javascript?



简答:你不能。

这是出于安全考虑。

想象一下,你访问一个随机网站,它会在你的PC上启动它想要的任何EXE。


Short answer: you can't.
It is for security reasons.
Just imagine, you visit a random website and it launch any EXE it wants on your PC.


你不能。如果可以的话,那里的每个恶意软件网站都会这样做。



您的现有代码仅适用于Windows上的Internet Explorer,并且仅在用户拥有时(愚蠢地) )勾选初始化并编写未标记为可安全编写脚本的ActiveX控件选项。



您可能偶尔会发现一个安全漏洞您从网页启动可执行文件。但它们往往很快得到报告和修复。
You can't. If you could, every malware site out there would be doing it already.

Your existing code only works in Internet Explorer on Windows, and only if the user has (foolishly) ticked the "initialize and script ActiveX controls not marked as safe for scripting" option.

You might occasionally find a security bug which lets you launch an executable from a web page. But they tend to get reported and fixed very quickly.


这篇关于如何使用javascript从chrome浏览器运行.exe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆