如何制作超级链接到本地​​可执行文件? [英] How do I make a hyperlink to a local executable?

查看:135
本文介绍了如何制作超级链接到本地​​可执行文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我们如何在Intranet上创建一个超链接?

    我们有一个Intranet网站,并在每个工作站上安装了WPF Windows可执行文件。网站将启动本地安装的可执行文件?


  2. 理想情况下,我们希望启动无缝。是否有设置浏览器信任设置的方法,以便它不会显示此可执行文件的安全警告对话框?

每个工作站上的全部管理功能,每个用户只使用Internet Explorer。我们也知道exe的正确本地路径。

更新
我们试过了这个锚标签,但是当我们点击它,我们得不到回应:

 < a href =c:\Flipper\Splash.Flipper.exe >点击此处< / a> 

我们也通过谷歌浏览器尝试了这个功能,并且我们也得到了相同的响应。如果您的用户真的只使用IE浏览器,您可以使用以下代码片段:

 < script type =text / javascript> 
函数runNotepad(){
var Shell = new ActiveXObject(WScript.Shell);
Shell.Run(%WINDIR%\\\\
otepad.exe);
}
< / script>
< a href =#onclick =runNotepad(); return false;>运行记事本< / a>

然而,如果有任何明智的安全设置,这会导致很多警告(并且正确无误!) 。


We have an Intranet website, and a WPF windows executable installed on every workstation.

  1. How can we create a hyperlink on the intranet website that will launch the locally installed executable?
  2. Ideally we want the launch to be seamless. Is there a way of setting the browsers trust settings so that it won't display a security warning dialog for this executable?

We have full admin capabilities on each workstation, and each user only uses Internet Explorer. We also know the correct local path for the exe.

Update: We tried this anchor tag, but when we click on it, we get no response:

<a href="c:\Flipper\Splash.Flipper.exe">Click Here</a>

We have also tried this via Google Chrome, and we get the same (lack of) response. Clicking the link causes nothing to happen.

解决方案

If your users really use only IE you can use this snippet:

<script type="text/javascript">
    function runNotepad() {
        var Shell = new ActiveXObject("WScript.Shell");
        Shell.Run("%WINDIR%\\notepad.exe");
    }
</script>
<a href="#" onclick="runNotepad(); return false;">Run Notepad</a>

However, with any sensible security settings this leads to an awful lot of warnings (and rightfully so!).

这篇关于如何制作超级链接到本地​​可执行文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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