Click here to Skip to main content
12,953,937 members (43,155 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 7 Sep 2010

How to launch external application or file from Silverlight 4

, 7 Sep 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Launching external application or file from Silverlight 4 (out-of-browser) using Automation Factory


I have been recently trying to automate the instalation of COM server for my Silverlight app and I found it pretty hard to find any solution. The thing is I wanted to run the downloaded setup file from Silverlight code, which turned out to be not so easy in Silverlight application.


Reading KunalChowdhury's article (File Explorer using Silverlight 4 COM Interoperability), I have noticed he pointed out it is possible using COM.
After quite annnoying search I have finally found SpoonStomper's post on Silverlight forum.
Original solution was for JavaScript using ActiveX but, as I have checked immediately, it works also with AutomationFactory in Silverlight 4.

private void Run(string path)
        dynamic shell= AutomationFactory.CreateObject("");;
     catch (System.Exception)

The Run method creates shell object and runs application or file with path given in param. It allows to launch any external application or open any file with program related to this file.

WScript reference can be found here.

This solution will work only in out-of-browser mode with elevated permisions.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Junior) freelancer
Poland Poland
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
mtss9221-May-14 1:26
membermtss9221-May-14 1:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 7 Sep 2010
Article Copyright 2010 by kj-dev
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid