从浏览器在客户端运行命令
对于我们的 IntraNET,当用户单击链接时,我们需要运行应用程序。安全性是通过另一种方式实现的(apache、防火墙)。这仅适用于我们公司的用户。操作系统为WindowsXP+(部分Linux)。
我尝试链接到脚本文件(http://intranet.domain.com/run.bat):
Chrome
- 无法更改 mimetype
- 浏览器下载它,双击并发出警告后,它可以与 .bat 一起使用
Opera
- 通过 mimetypes 调整,它可以在点击后立即使用 .lnk 文件
- 具有 mimetypes 调整功能,它可以在单击
Firefox
- 通过 mimetypes 调整,它可以在点击后立即使用 .lnk 文件
- ,它可以在单击
Explorer
- .bat 文件在发出警告后运行,然后单击“运行”
Safari
- .bat 文件在发出警告后运行,然后单击“运行”
。它可以工作,但会出现警告并单击。也许还有一些其他使用 AIR2 插件或 NPAPI 插件的解决方案(我在这里阅读),但我没有经验。
我正在寻找为此目的编写的现成可用的插件(也是商业的)。当然,我们可以在客户端计算机上安装任何应用程序/插件。我可以在网页上呈现并配置为在单击事件上运行一些带有参数的命令的插件(命令和参数可能会在每个页面加载时发生变化,无法在插件中编译)。
我知道,关于这个主题有一些问题,但是..我没有找到好的解决方案。感谢您的帮助。
For our intraNET we need to run application, when user clicks on link. Security is done another way (apache, firewall). This is only for users in our company. Operation system is WindowsXP+ (some Linux).
I tried link to script file (http://intranet.domain.com/run.bat):
Chrome
- can't change mimetype
- browser downloads it, and after doubleclick and warning it works with .bat
Opera
- with mimetypes tunning, it works with .lnk file, immediatly after click
Firefox
- with mimetypes tunning, it works with .lnk file, immediatly after click
Explorer
- .bat file works after warning and click on 'Run'
Safari
- .bat file works after warning and click on 'Run'
It works, but with warnings and clicking. Maybe there are some other solutions (i read here) using AIR2 plugin or NPAPI plugin, but i have no experiences.
I am looking for ready to use plugin written for this purpose (commercial too). Of course we can install any application/plugin on client computer. Plugin which i can render on webpage and configure to run some command with parameters on click event (command and parameters could change on every page load, can not be compiled in plugin).
I know, there are some questions on this topic, but.. i did not find good solution. Thank you for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所有这些警告都是有原因的!如果您可以在没有警告的情况下以这种方式运行批处理文件,这将是一个巨大的安全风险。
实现此功能的最佳方法是编写一个签名的 ActiveX 控件,用户将其下载到他们的 PC、安装(这将要求用户确认他们希望安装该控件),然后让 ActiveX 控件运行批处理文件。这将允许 ActiveX 控件在不提示用户的情况下运行批处理文件,但是对于一次性操作来说可能比其价值更麻烦。
All those warnings are there for a reason! If you could run a batch file in this way without warning this would be a huge security risk.
The best way to get this to work would be to write a signed ActiveX control that users download to their PC, install (which would require that the user confirm that they wish to install the control) and then have the ActiveX control run the batch file. This would then allow the ActiveX control to run batch files without prompting the user, however is probably way more hassle than its worth for a one-off action.