So now you can add a folder to sync in OneDrive. Actually, the ability to choose which folders to sync between OneDrive and your computer was already present in Microsoft OneDrive for a very long time, but I believe there’s a little bit more we need to look at here.
When we talk about how to add a folder to sync in OneDrive, we need to establish first on which side you want to sync your folder. The thing with syncing is, it goes in two directions.
The first option (select a OneDrive folder to be synced to your local hard drive) is the most common one, but what if you want to be able to select any folder on your local hard drive and make sure it will be synced to your OneDrive cloud storage? Well, with a little trick you can also get that done (hint: you’ll need to make use of a neat little feature in Windows 10 called symbolic links).
But first let’s quickly review how to select a folder in OneDrive and sync it to your computer.
In order to add a folder to sync in OneDrive from your cloud storage to your computer, right-click the OneDrive icon in file explorer and select “settings”. (If you don’t have a OneDrive icon in file explorer you need to set up OneDrive first).
OneDrive will now display the settings screen:
In your OneDrive settings screen, select the “Account” tab and click the “Choose folders” button. (It says folders you choose will be available on this pc so already hints about the direction of synchronization)
In the next screen you will get an overview of all your folders in your OneDrive cloud storage. If you want to add a folder to sync in OneDrive, simply click the checkbox next to the folder.
You can of course also click on the arrows next to your folders to see and select subfolders (if there are any).
Click the ok button to confirm your selection and let OneDrive start synchronizing your files.
Oh and, by the way, if you’re not sure what this “on demand” business is all about, feel free to learn more about this in my article on OneDrive file statuses.
Ok so all well and good, but what if you want to select any folder on your computer (local storage) and sync that to OneDrive?
We already know that OneDrive can backup all files in your “Desktop”, “Documents” and “Pictures” folder to OneDrive.
That means that whatever you put in your “documents” folder will automatically be synced to OneDrive.
You can also tell that these files are being synced by the OneDrive file status icons (on the right hand side in the image above).
But what if you want to sync a folder that’s not in your documents (or desktop or pictures folder) to OneDrive? Well, let’s find out.
How to sync any folder to OneDrive in Windows 10?
Let’s say you have a folder called a-folder-to-be-synced-to-onedrive on your c: drive that you want to sync to OneDrive.
If you want to add a folder to sync in OneDrive like that, you need to trick OneDrive into thinking that this specific folder is in its own folder.
What do I mean by “its own folder”?
Well, if you take another look at the OneDrive settings screen where you select your folders to be synced, you’ll notice that OneDrive reveals its location on your local hard drive, where it keeps the local copies of your cloud files.
Windows 10 stores the location of your OneDrive folder in a system variable called “UserProfile%\OneDrive\”, so you’ll be able to use that in the next steps.
Now in order to add a folder to sync in OneDrive, open a command prompt first.
In the command prompt, type the following:
mklink /j "%UserProfile%\OneDrive\a-folder-to-be-synced-to-onedrive" "c:\a-folder-to-be-synced-to-onedrive"
where you substitute “a-folder-to-be-synced-to-onedrive” with your own folder name.
and then press ENTER.
If all goes according to plan, you will get a response that a junction is created for your folder.
And that's it! The magic has already happened. Congratulations, you just succeeded to add a folder to sync in Onedrive. You'll notice a little arrow next to the folder name in OneDrive, indicating that the folder is a link, but OneDrive will automatically sync the contents of the folder nevertheless.
This method allows you to sync a folder to OneDrive without moving the original folder.
Pat yourself on the back. Or if you’re not very flexible, have somebody else pat your back for you. You’ve done well.
Should you ever want to stop syncing that folder in OneDrive, simply delete the folder from your OneDrive folder in file explorer. The original folder on your local hard drive will not be deleted, but it will stop syncing with OneDrive.