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

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

问题描述

我们有一个 Intranet 网站,并在每个工作站上安装了 WPF Windows 可执行文件.

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

  1. 我们如何在 Intranet 网站上创建一个超链接来启动本地安装的可执行文件?
  2. 理想情况下,我们希望发布是无缝的.有没有办法设置浏览器的信任设置,以便它不会为此可执行文件显示安全警告对话框?

我们在每个工作站上都​​有完整的管理功能,每个用户只使用 Internet Explorer.我们也知道 exe 的正确本地路径.

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:FlipperSplash.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.

推荐答案

如果你的用户真的只使用 IE 你可以使用这个片段:

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天全站免登陆