views:

62

answers:

4

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.

A: 

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
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
I did a quick test and it doesn't work for me either.
musicfreak
We used IE6, if that is helpful. I find it strange it didn't try to do anything at all.
Jage
A: 

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

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
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
Thanks, but changing the url format to use file:/// produces the same behaviour. We just get no response when we click
Scott Ferguson
@Scott: Really? In what browser? It worked for me in IE/FF
Marko
IE8, and Google Chrome
Scott Ferguson
+1  A: 

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