Sync any folder in Windows 11 or 10 with OneDrive

Stefan
Sync any folder in Windows 11 or 10 with OneDrive

If you have synced folders with OneDrive, the contents of these folders will be copied to the OneDrive cloud. This means that your files are always duplicated and you don't have to worry about losing files.

The following folders are synced by OneDrive by default. You can adjust this in the settings. These are the Documents, Pictures, Desktop, Music and Video folders. But what if you want to add another folder on your computer to the OneDrive sync backup?

This article explains how you can add a folder to OneDrive Synchronization so that this specific folder is also included in the backup. You can sync any folder with OneDrive using this tip. This is how it works.

Sync any folder in Windows 11 or 10 with OneDrive

To sync any folder on your computer with OneDrive, use the command “mklink”. This command is known as “Symbolic Links” or “Symlinks”.

mklink acts as an alias for the original file or folder and can be used interchangeably. Unlike a hard link, a symbolic link does not link the contents of the files, but points to the file name and its location. By using mklink you can link a subfolder in the OneDrive sync folder to another folder on your PC. This will also include this folder in the OneDrive backup.

Open a Command Prompt as administrator.

Enter the following command. Make sure to make the following adjustments first.

mklink /J "%userprofile%\OneDrive\PCtips" "C:\PCTips"

PCTips in this case the name of the folder will be visible in the OneDrive sync. You don't create this folder, it is created.

Read also
Disable Windows Defender in Windows 11? Complete guide!

"C:\PCTips” in this case is an example folder that is included in the OneDrive backup. So change this to the folder that you want to include in the OneDrive backup. Don't forget the quotes.

If everything went well you will see the message “Junction created for”. This means that the symbolic link has been created. As you can see in the example below, you will see that the contents of my example folder “C:\PCTips” are synced via OneDrive to the OneDrive folder “PCTips”.

This way you can sync any folder on your computer, or external hard drive (when connected) to the OneDrive folder.

Mklink OneDrive

To remove the link, delete the relevant folder in OneDrive.

I hope this worked. Thank you for reading!

Also read this tip: Share files via OneDrive in Windows? This is how!


Problem solved?


Help other people too.
Share this article on a website, forum or via social media.

Join our new computer forum for questions and computer help.
Do you have a computer question?

The email address will not be published. Required fields are marked with *