Base on bash.d answer, I create my own copy folder:
namespace Directories { private string ROOT = "root"; public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); CopyFolder(ROOT); } private async void CopyFolder(string path) { IStorageFolder destination = Windows.Storage.ApplicationData.Current.LocalFolder; IStorageFolder root = Windows.ApplicationModel.Package.Current.InstalledLocation; if (path.Equals(ROOT) && !await FolderExistAsync(ROOT)) await destination.CreateFolderAsync(ROOT); destination = await destination.GetFolderAsync(path); root = await root.GetFolderAsync(path); IReadOnlyList<IStorageItem> items = await root.GetItemsAsync(); foreach (IStorageItem item in items) { if (item.GetType() == typeof(StorageFile)) { IStorageFile presFile = await StorageFile.GetFileFromApplicationUriAsync( new Uri("ms-appx:///" + path.Replace("\\", "/") + "/" + item.Name));
This example uses root as the root folder:
- root - sub1 - sub1-1.txt - sub1-2.txt - sub1-3.txt - sub1-4.txt - sub2 - sub2-1.txt - sub2-2.txt - sub2-3.txt - sub2-4.txt - root1.txt - root2.txt - root3.txt - root4.txt
It will copy from InstalledLocation to the LocalFolder folder.
source share