Reputation: 964
This seems like it should be so simple. Currently, I am "finding" this by iterating through the Quick Access entries for one marked "OneDrive" and getting the path. Looks like another way is to get the environment variable "OneDrive".
I have a little editor, and I'd like the user to be able to save the file "to the cloud". It occurred to me that an easy way to do this is to just save it to the OneDrive folder, and let the sync thing do it's thing.
Am I missing something obvious?
Upvotes: 0
Views: 3828
Reputation: 169400
Environment.GetEnvironmentVariable("OneDriveConsumer")
or Environment.GetEnvironmentVariable("OneDriveCommercial")
should give a reliable path depending on whether you have one or several OneDrive clients on your machine.
Upvotes: 3
Reputation: 13292
I would recommend using the reserved %onedrive%
environment variable that points to the OneDrive path for the currently logged-on user. Is there anything stopping you from using this?
Upvotes: 1