2

How can you detect the location of the Onedrive Desktop Client's folder?

I'm looking for the Onedrive equivalent of this Dropbox question.

Edit: This applies to detection of the desktop version in Vista/7 as well as the version that ships with 8.1.

3
  • 1
    This entirely depends on the version of Windows (and Skydrive). Windows 8.1 for instance now has built in support for Skydrive which means the Skydrive directory is party of the user's profile.
    – Ramhound
    Oct 30, 2013 at 12:09
  • What Windows version are you talking about ?
    – Devid
    Mar 9, 2014 at 11:01
  • Anything after Vista - have added that to the question. Mar 10, 2014 at 11:17

1 Answer 1

3
+50

You can take a look at this post from Microsoft forums. It seems to have two ways to do it.

Both the .ini file and the registry key are currently reliable ways of retrieving the local SkyDrive folder.

You can find the Registery key at HKEY_CURRENT_USER\Software\Microsoft\SkyDrive, with the name UserFolder.

// C# sample
String SkyDriveFolder = Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\SkyDrive", "UserFolder",null).ToString();

You can find the .ini file at C:\Users\{username}\AppData\Local\Microsoft\SkyDrive\settings

Follow this steps :

  1. Get the name of the single .DAT file that exists here.

  2. Find the .INI file with the same name (sans extension) as the .DAT file. The reason you are doing this is because there is more than one .INI file, but only a single .DAT file, and it shares the name with the .INI file you need.

  3. Open this .INI file and parse the final line, which begins with "library". The final piece of this line is the local mapping path.

Hope this can help.

4
  • Thank you, that's what I wanted. It doesn't seems to work in 8.1, but I'll pursue that on Stack. Mar 14, 2014 at 7:43
  • FYI, link to microsoft forum doesn't seem to work anymore
    – Rick Berge
    Mar 28, 2016 at 19:03
  • @RickBerge Indeed. I copy/pasted the answer from the other thread. It shouldn't be a problem.
    – aloisdg
    Apr 20, 2016 at 2:06
  • Looks like OneDrive for Business is here HKCU\Software\Microsoft\OneDrive\Accounts\Business1 as UserFolder Oct 19, 2017 at 2:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .