When to use this:
- Add folder to OneDrive without moving
- OneDrive add folder to sync
- OneDrive add folder to backup
- OneDrive add folder to sync Windows 10
Requirements:
- OneDrive client
Method:
Step 1) Sign in to OneDrive:
https://www.windowscentral.com/how-get-started-onedrive-windows-10#setup_onedrive_windows10
Step 2) Make a list of all the folders or individual files that you want to sync with OneDrive. Personally, I find it easier to copy them into Notepad.
Examples:
D:\inetpub\wwwroot\
C:\Users\Intuitive\Saved Games\Diablo II\
Step 3) Use the below templates accordingly; the ‘blue‘ text will be the name of the folder as you want to appear in your OneDrive account, and the ‘red‘ text is the path of local folder on your hard drive to add into OneDrive. Do not change the ‘black text‘.
(For colour-blind people: follow the first line example. The first instance of the word “wwwroot” will be the name of the folder that you want to appear in your OneDrive account, and the “D:\inetpub\wwwroot\” is path of the local folder that you want to sync with OneDrive.)
To sync entire folders (including subfolders):
mklink /j “%userprofile%\OneDrive\wwwroot” “D:\inetpub\wwwroot\“
mklink /j “%userprofile%\OneDrive\Diablo-Saves” “C:\Users\Intuitive\Saved Games\Diablo II\“
To sync individual files:
mklink “%userprofile%\OneDrive\BOOKMARKS” “%localappdata%\Google\Chrome\User Data\Default\Bookmarks“
EXAMPLES:
Here are some real-life examples which will work for anyone. You don’t need to customize these command for your computer, so you can copy/paste them directly into a Command Prompt:
Google Chrome bookmarks
mklink “%userprofile%\OneDrive\BOOKMARKS” “%localappdata%\Google\Chrome\User Data\Default\Bookmarks”
Notepad++ unsaved files
mklink /j “%userprofile%\OneDrive\NOTEPAD” “%appdata%\Notepad++\backup\”