1

I am a complete beginner on this - being a software person doing some voluntary work for a charity, and having been asked to set up an intranet for them using Sharepoint (which I know nothing whatsoever about).

One thing I would like to be able to do is start a Windows app (.EXE, available via a network share to all relevant users) from a link on a page.

Cannot see there is any mechanism for doing this. For various reasons it will not be practical to direct the link to an app data file for the app, then rely on Windows file association to start it up - I need to start the actual executable directly.

Any suggestions on how to do this?

1 Answer 1

0

Found the following on a codeproject page, and adapted it:

<script type="text/javascript">
<!-- Start of script hiding
    function __LaunchExe(ExePath)
    {
        var    s = new ActiveXObject("WScript.Shell");

        s.Exec(ExePath);
    }

// End of script hiding -->
</script>

<body>
<h1>Launch EXE test</h1>
<p>This is only going to work on IE, on an actual PC.</p>
<!-- BEGIN block -->
<a href="javascript:__LaunchExe('C:\\Program Files\\Lisson Grove\\QBC\\qb4.exe')">Click here</a> and 'C:\Program Files\Lisson Grove\QBC\qb4.exe' ought to launch.
<p>Everything in the relevant zone (ie trusted sites) security options for ActiveX controls has to be enabled for this to work.</p>
<!-- END block -->
</body>

Limited to IE by ActiveX. Starts a shell control, and then gets the shell to exec the passed in path. In a real situation this would be a UNC network path available to all users.

This works fine in a normal web page using IE (6) providing all the relevant ActiveX security settings are set to enabled for the (local) zone. Need to find out if it will work in the SharePoint environment next. Can't see why it wouldn't since it is down to the client browser.

Could probably be made to work with Firefox as well as there is supposed to be an add-on that allows hosting of ActiveX controls.

A lot of people will say one should never do this type of thing on principle, bad practice, breaks security, limited to certain browsers etc, but the reality is that if one is developing for a closed system - one does what is necessary and desirable for the users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.