How do I make a hyperlink to a local executable?

后端 未结 4 1309
忘了有多久
忘了有多久 2020-12-10 15:24

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 launc
相关标签:
4条回答
  • 2020-12-10 16:02

    I have links to UNC folders/files inside my intranet portal and I've found that the clients need to have the local domain name "mycompany.local" added in their "Trusted Sites". I have also found this only works in IE (verified not working in FireFox and Safari).

    0 讨论(0)
  • 2020-12-10 16:10

    Use the file:/// prefix.

    Like so:

    <a href="file:///C:/Windows/notepad.exe">asd</a>
    

    I'm not sure if you'll be able to get past the security dialog though (open, save, cancel).

    0 讨论(0)
  • 2020-12-10 16:11

    If you know the path for the file and it's the same on every machine, you can link to the local path:

    <a href="C:\Windows\prog.exe">Click Here</a>
    

    We did this at a previous company on our intranet. Worked, no problem.

    0 讨论(0)
  • 2020-12-10 16:22

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

    0 讨论(0)
提交回复
热议问题