Where is ms-appdata?
Asked Answered
S

1

6

I am building a modern ui app and want to, with a batch file, write and periodically update data accessible though the ms-appdata:// protocol in my winjs app. I have the batch file to copy folders, but I cannot find the file path of the appdata.

What is the default filepath for App1's appdata and how can I force my app to create the folder?

Skip answered 29/1, 2015 at 20:57 Comment(0)
D
9

ms-appdata:///[local | roaming | temp]/ maps to the StorageFolder returned from Windows.Storage.ApplicationData.Current.localFolder, roamingFolder, and temporaryFolder. See https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.applicationdata.localfolder.aspx as an example. So you can obtain the appropriate StorageFolder from that API create folders and files from there, and then use ms-appdata URIs to refer to them.

Note that you always want to use the Windows.Storage.ApplicationData API to access those folders rather than using absolute pathnames. StorageFolder and StorageFile are the WinRT abstractions for pathnames and wholly replace them.

Dinette answered 30/1, 2015 at 1:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.