Having a simple trick, you can sync a folder that is not in OneDrive folder with OneDrive in Windows. Allow me to demonstrate.
OneDrive is among the most favored cloud storage services and is built into Windows 10. To sync a file or folder with OneDrive cloud, all you need to do is create, move or copy the contents into the OneDrive folder. This lets you sync your important files to be able to access them anywhere you would like as long as you have an internet connection.
However, if you wish to sync a folder that’s outside the OneDrive folder without moving or copying it, then you need to do some magic. So, without further ado, let me show you how you can sync any folder, regardless of its location, with OneDrive.
How Do We Do This?
Since we do not wish to copy or slowly move the target folder to the OneDrive folder, we are going to produce a symbolic link with directory junction. With this option, it makes a kind of outcomes of the origin directory and the destination directory. Though the junction directory looks like a normal folder for normal users, it is nothing but a kind of shortcut that allows you to access the source directly.
Now, I know all of this sounds complicated. However, used it is really easy. Just stick to the below steps and you’ll be good to go.
Steps to Sync Folder Outside OneDrive Without Moving or Copying
As I said, we have to produce a Symbolic Link. To achieve that we need to make use of the Command Prompt.
1. First, open the beginning menu, look for “Command Prompt” and then click the end result to open the Command Prompt.
2. Within the Command Prompt, execute the below command while replacing the dummy paths using the actual paths.
mklink /J “%UserProfile%\OneDrive\DestinationFolder” “D:\SourceFolder”
Here, the very first path is where you want to produce the new directory junction. Within our case, that’s within the OneDrive folder. You can name the folder anything you like by replacing “DestinationFolder”. Generally, it is useful to name the folder identical to the source.
The second path is the source folder path. i.e, the folder you’d like to sync with OneDrive.
Note: If you have moved the OneDrive folder from the default location, you need to customize the first path in the command to mirror that change.
3. Once you execute the command, you will see the “Junction Created” message.
That’s it. If you open the OneDrive folder, you will see a new folder with the name you’re considering within the command. To differentiate the junction directory from the other folders, you will see a little arrow overlay icon which suggests that it is only a shortcut and not a real folder.
Obviously, whenever you open the junction folder, you will see all your files from the source folder.
From this point forward, any modifications you make within the source folder is going to be instantly reflected in the junction folder and therefore are synced to OneDrive.
Items to Bear in mind
Any changes you make either in from the folders will reflect in the other folder. Remember, case a link/shortcut. You are not copying the files.
Since the junction directory is just a link, you can’t use the Files when needed feature on this specific folder. Other regular folders and files are not affected, though.
Should you ever want to remove the link, simply delete the junction directory inside the OneDrive folder. This action won’t delete the origin folder. If you’re unsure, backup the origin folder after which delete the junction directory.