This tutorial will show you how to sync any folder to OneDrive for your account in Windows 10 and Windows 11.
You can use OneDrive to sync files and folders between your computer and the cloud, so you can get to your files from anywhere - your computer, your mobile device, and even through the OneDrive website at OneDrive.com. If you add, change, or delete a file or folder in your OneDrive folder, the file or folder is added, changed, or deleted on the OneDrive website and vice versa. You can work with your synced files directly in File Explorer and access your files even when you’re offline. Whenever you’re online, any changes that you or others make will sync automatically.
By default, you can choose folders in your OneDrive folder on your PC to sync with your online OneDrive (cloud).
You can also choose to back up your account's Desktop, Documents, Music, Pictures, and Videos folders to your OneDrive folder on your PC to sync with your online OneDrive (cloud).
However, what do you do if the folder you want to backup and sync to OneDrive is not listed above since there's not an option to select it?
As a workaround, you can create a junction point to link any folder at any location into your OneDrive folder on your PC that will sync with your online OneDrive (cloud).
- Deleting a file from either the source folder location (ex: "E:\Example Folder") or junction point folder in OneDrive (ex: "C:\Users\Brink\OneDrive\Example Folder") will delete the file from both locations.
- Deleting the junction point folder in OneDrive (ex: "C:\Users\Brink\OneDrive\Example Folder") will not delete any files in the source folder location (ex: "E:\Example Folder") or the source folder, but will remove the junction point to stop syncing the source folder with OneDrive.
Here's How:
1 Open a command prompt.
2 Type the command below into the command prompt, and press Enter. (see screenshots below)
mklink /j "%UserProfile%\OneDrive\Junction point folder name" "Full path of source folder"
Substitute Full path of source folder in the command above with the actual full path of the folder (ex: "E:\Example Folder") you want to sync with your OneDrive.
Substitute Junction point folder name in the command above with the folder name (ex: "Example Folder") you want to show in your OneDrive folder (ex: "C:\Users\Brink\OneDrive"). This folder is a junction point linked to the source folder. It is recommended to use the same name as the source folder to help know what it's linked to, but you can name this junction point folder any name you want. This must be a new folder name that isn't already in your OneDrive folder. This junction point folder will get created in your OneDrive folder with the name you specify here.
For example:
mklink /j "%UserProfile%\OneDrive\Example Folder" "E:\Example Folder"
3 You can now close the command prompt if you like.
That's it,
Shawn Brink
- How to Create Soft and Hard Symbolic Links in Windows
- Find All Symbolic Links and Junction Points in Windows
- Set up OneDrive in Windows 11
- Turn On or Off OneDrive Run at Startup in Windows 11
- Pause and Resume OneDrive Syncing in Windows 11
- Choose which OneDrive Folders to Sync in Windows 11
- Turn On or Off OneDrive Folder Backup Syncing Across Windows 11 Devices
- Turn On or Off Save Photos and Videos from Devices to OneDrive in Windows 11
- Turn On or Off Save Screenshots to OneDrive in Windows 11