LaunchFileAsync(IStorageFile, LauncherOptions) | launchFileAsync(IStorageFile, LauncherOptions) method
Collapse the table of content
Expand the table of content

Launcher.LaunchFileAsync(IStorageFile, LauncherOptions) | launchFileAsync(IStorageFile, LauncherOptions) method

Starts the default app associated with the specified file, using the specified options.


Public Shared Function LaunchFileAsync(
  file As IStorageFile,  
  options As LauncherOptions 
) As IAsyncOperation(Of Boolean)



Type: IStorageFile

The file.


Type: LauncherOptions

The launch options for the app.

Return value

Type: IAsyncOperation<Boolean>

The launch operation.


The calling app must be visible to the user when the API is invoked.

This API must be called from within an ASTA thread (also known as a UI thread).

This API also imposes several restrictions on what types of files it can launch. Many file types that contain executable code, for example .exe, .msi, and .js files, are blocked from launching. This restriction protects users from potentially malicious files that could modify the system.

When the launch fails for any of the above reasons, the API succeeds and returns FALSE from its asynchronous operation. Since it has no ability to query whether the above restrictions apply to the current launch, the calling app should not assume that the launch succeeded, and should provide fallback mechanism in case it failed. A possible solution would be to ask the user to save the file and direct the user to open it in the desktop.

To enable the user to choose an app instead of launching the default app, set the LauncherOptions.DisplayApplicationPicker | displayApplicationPicker property.

To display a warning that the file is potentially unsafe, set the LauncherOptions.TreatAsUntrusted | treatAsUntrusted property.

The file is passed to the associated app. If the associated app is a desktop app, the file is passed using shell execution mechanisms.


Call the Launcher.LaunchFileAsync(IStorageFile, LauncherOptions) | launchFileAsync(IStorageFile, LauncherOptions) method with LauncherOptions.DisplayApplicationPicker | displayApplicationPicker set to true to launch the app that the user selects for the file from the Open With dialog box.

async Sub DefaultLaunch()

   ' Path to the file in the app package to launch
   Dim imageFile = "images\test.png"

   Dim file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(imageFile)

   If file IsNot Nothing Then
      ' Set the option to show the picker
      Dim options = Windows.System.LauncherOptions()
      options.DisplayApplicationPicker = True

      ' Launch the retrieved file
      Dim success = await Windows.System.Launcher.LaunchFileAsync(file, options)

      If success Then
         ' File launched
         ' File launch failed
      End If
      ' Could not find file
   End If
End Sub

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::System [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::System [C++]



See also

Association launching sample
Guidelines for file types and URIs
How to launch the default app for a file (JavaScript)
Launch the default app for a file
LaunchFileAsync(IStorageFile, LauncherOptions)



© 2016 Microsoft