Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

html - How do I make a hyperlink to a local executable?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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!).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...