UWP: Open the
file Explorer from a Windows app
would like to start the file Explorer from my Windows 10 app and do open a
folder whose path I want to pass at boot.
universal Windows platform application)
this, use the Launcher in window 10. The Launcher
can open files, directories, search results and Web paths.
Launcher. LaunchFolderAsync (folder)
can open a directory object to display.
that you can pass a directory, you must this previously with Storagefolder. Determine GetFolderFromPathAsync(Path) .
private async void menuItem_Open_Explorer (object sender, RoutedEventArgs e)
< get folder >
string sPath path; =
StorageFolder folder = await StorageFolder. GetFolderFromPathAsync(sPath);
< / get folder >
< open file Explorer >
await Launcher. LaunchFolderAsync(folder);
< / open file Explorer >
menuItem_Open_Explorer() > -.
this purpose, the namespaces are needed for the folder and the Launcher:
using Windows.System; //Launcher
using Windows.Storage; //Files File.AccessMode
example I start that open Explorer event with a flyout menu. This starts the Click Event -> menuItem_open_Explorer
<TextBlock x : Name = "ctlTitel" Grid.Column "1" = Text = "Folder" FontFamily = "Arial" FontSize = "14" TextTrimming = "Clip" TextWrapping = "Wrap" IsTextSelectionEnabled = "True" VerticalAlignment "Center" Margin= "3,0,0,0"
IsHitTestVisible = "True" RightTapped =
<MenuFlyout x : Name = "menuFolderTitle" Placement = 'Right' >
<MenuFlyoutItem Text FlowDirection= "LeftToRight" = "open Explorer" click= "menuItem_Open_Explorer"> < /MenuFlyoutItem>
open Explorer context menu to trigger the event
follows that the file Explorer as a separate application is started
thereby open the specified folder
as video tutorial