8

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.

Scott Ferguson
  • 7,690
  • 7
  • 41
  • 64

4 Answers4

3

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

Henning
  • 11,496
  • 5
  • 27
  • 25
  • how to use a Free BHO (browser helper object) with custom setup? In case not to have lot of awful and warnings? Many company now doing it. Is there no simple free open srouce BHO for Javascript which can be customized? –  Mar 21 '14 at 06:43
0

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.

Jage
  • 7,990
  • 3
  • 32
  • 31
  • Thanks for the suggestion, but there must be more to it. When we click the hyperlink, nothing happens. Not even a security dialog. Perhaps in your previous company it was with an older version of IE that allowed this? – Scott Ferguson May 12 '10 at 03:56
  • We used IE6, if that is helpful. I find it strange it didn't try to do anything at all. – Jage May 12 '10 at 14:43
0

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

Zachary
  • 6,522
  • 22
  • 34
  • This sounds promising, but we are having trouble setting the right wildcard sequence in Trusted sites. Are you sure this can be done for local files? The examples provided in IE show local network shares, but not local files.. – Scott Ferguson May 12 '10 at 03:59
0

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

Marko
  • 71,361
  • 28
  • 124
  • 158
  • That does indeed give the Open/Save/Cancel dialog, however, apps more complex than notepad probably won't work as the file is "downloaded" to the temporary folder and launched there. It does not launch the original file. – Henning May 12 '10 at 20:53
  • Thanks, but changing the url format to use file:/// produces the same behaviour. We just get no response when we click – Scott Ferguson May 12 '10 at 21:22