Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to launch an exe from the users local system (assuming the exe exists locally) from a SharePoint ribbon control. Is this something that is possible to do? If it is, how do I do this. If I need to launch something intermediary that would be fine as well. Just wondering how I can do this.

Edit: Just doing some more googling, it looks like the only way I might be able to do this is to create a SilverLight 4.0 application that I launch from the ribbon and then use the WScript COM object from the SilverLight app to launch an application.

Again, any thoughts or ideas on how to do this will be much appreciated.

EDIT: After going about the custom protocol route, this did work, but I was still running into security setting issues (especially with IE 8.0, never tried IE 7). I could get my app to launch through Chrome with a warning being displayed, but never could quite get it to work with IE. Due to some other design changes, basically this approach became impossible. What I ended up finally doing is to create a WCF application that would open a NetTcp channel on localhost, then from my ribbon control, I pass data over via the WCF interface to the localhost channel. This appears to be working for now.

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Create a reg file and install on the user's computer (this might be too restrictive for you though)

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\yourprotocol]
"EditFlags"=dword:00000002
"URL Protocol"=""
@="URL:yourprotocol protocol"

[HKEY_CLASSES_ROOT\yourprotocol\shell]

[HKEY_CLASSES_ROOT\yourprotocol\shell\open]

[HKEY_CLASSES_ROOT\yourprotocol\shell\open\command]
@="C:\\yourscript.exe %1"

Then output your protocol links in your URLAction

  <CommandUIHandlers>
    <CommandUIHandler
      Command="Ribbon.Extended.SPC3.CreateListProfileField"
      CommandAction="yourprotocol://?arg1=1&arg2=2" />
  </CommandUIHandlers>

http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx

share|improve this answer

You might be able to cut out the silverlight bit altogether and use WScript/COM from Javascript. User's browsers will need to be set up correctly though to allow that.

Example

http://www.olavaukan.com/tag/wscript/

share|improve this answer
    
Thanks for this suggestion, in my case I can't have the user turn down the security settings. I am running an installer and so I will be able to use the registry key protocol hack. –  pstrjds Jan 12 '11 at 13:53

I think you can map hyperlink protocols to applications on client machines (not sure how), so you can launch applications using normal hyperlinks.

I have seen hyperlinks like skype://phonenumber on the web, which launches Skype when you click it.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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