Last Updated on February 25, 2024 by Mathew Diekhake

You can run commands in the Windows 10 command line to sync a folder that’s on the computer to your OneDrive account.

Windows 10 also allows you to choose which folders you would like the operating system to sync to OneDrive automatically for you. The OneDrive folder can always be accessed via %UserProfile% in File Explorer.

The following tutorial demonstrates how to sync a folder to your OneDrive account when using a version of the Windows 10 operating system.

How to Sync Any Folder to OneDrive in Windows 10

You can sync a file on your computer (located in File Explorer et cetera) to your OneDrive account by running commands in the command line (CMD). Here is how to do that:

1. Open the Command Prompt.

2. Type the following command into the command line and press the Enter key on your keyboard to execute it:

mklink /j "%UserProfile%\OneDrive\folder Name" "path of source folder"

Note: Change where it says folder name with the actual name of the folder and path of source folder with the actual path.

CMD: mklink /j "%UserProfile%\OneDrive\Pictures" "D:\Pictures"

3. The specified folder is then synced to the specified OneDrive account.

In conclusion, that is how to sync a folder to a OneDrive account in Windows 10.