<div class="meta" robots="noindex">

</div>

Method

# FolderItem.Launch

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2.1. Please use `FolderItem.Open<folderitem.open>` as a replacement.

</div>

## Description

If the **FolderItem** is an application, the application is launched. If the **FolderItem** is a document, the document is opened and the application is launched if necessary.

## Notes

*Parameters* is the application's parameters to be passed to the launched application (Windows and Linux). The optional parameter *Activate* specifies whether the application should be launched in the foreground or background. The default value is `True</api/language/true>`(Foreground). If you specify `False</api/language/false>`, the app will be attempted to <span class="title-ref">Launch</span> in the background, but this may not work with certain applications.

Launch is not available in console applications.

MacOS does not <span class="title-ref">Launch</span> multiple copies of apps. If you need to <span class="title-ref">Launch</span> multiple copies of an app, you should use a Shell with the "open -n Appname.app" terminal command like this:

``` xojo
' myApp is a FolderItem pointing to the app you want to launch
Var sh As New Shell
sh.Execute("open -n " + myApp.ShellPath)
```

## Sample code

This example displays a PDF file in the built-in PDF viewer:

``` xojo
Var pdfFile As FolderItem
pdfFile = FolderItem.ShowOpenFileDialog("")
If pdfFile <>  Nil Then
  pdfFile.Launch
End If
```

## Compatibility

All project types on all supported operating systems.

## See also

`FolderItem</api/files/folderitem>` parent class; `Shell</api/os/shell>`
