Advertisement

Sync Any Folder to OneDrive in Windows 10

OneDrive is the online document storage solution created by Microsoft which comes bundled as a free service with Windows 10. It can be used to store your documents and other data online in the cloud. It also offers synchronization of stored data across all your devices. "Files on-demand" is a feature of OneDrive which can display placeholder versions of online files in your local OneDrive directory even if they were not synchronized and downloaded. Today, we'll see how to sync any folder to OneDrive so it will be available from any device connected with your Microsoft Account.

To make OneDrive sync a folder which is not located in your main OneDrive folder, we will create a directory junction. Directory junctions and other symbolic link types are covered in detail here:

Advertisеment

Everything you need to know about symbolic links in Windows 10

I recommend you to read the article above if you are not familiar with symbolic links.

In short, a directory junction is a classic type of symbolic link, which does not support UNC paths (network paths that begin with \\) and relative paths. Directory junctions are supported in Windows 2000 and later NT-based Windows systems. A directory symbolic link on the other hand also supports UNC and relative paths. For today's task, directory junction is suitable.

To sync any folder to OneDrive in Windows 10, do the following.

  1. Open an elevated command prompt.
  2. Type the following command: mklink /j "%UserProfile%\OneDrive\Folder name" "The full path to your folder". You need to substitute the 'Folder name' portion with the desired name which will reproduce your folder in the OneDrive storage. Also, provide the correct path to the destination folder that you want to sync. For example:
    mklink /j "%UserProfile%\OneDrive\Winaero-folder" "c:\data\winaero". Windows 10 OneDrive Sync Any Folder
  3. The specified folder will now be synced with your OneDrive.Windows 10 OneDrive Added Directory Junction
  4. To stop it from syncing, remove the 'Folder name' (e.g. 'Winaero-folder') from the OneDrive folder. This won't remove your actual folder from your drive (e.g. 'c:\data\winaero').

See the following screenshot:

Windows 10 OneDrive Syncing Directory Junction

That's it!

Related articles:

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

5 thoughts on “Sync Any Folder to OneDrive in Windows 10”

  1. This is great! BUT OneDrive says that it has “No access permissions to the item”. How do I change permissions so that OneDrive CAN access any item on my PC?

  2. Very close but not 100%.
    It works but it’s not “live”.
    If you modify/add/delete files in the linked custom folder (in this case c:\data\winaero) these modifications will not get synced automatically. You have to manually pause sync and resume, or kill onedrive and start it again.

    Anyone knows a solution to this?

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.