How to link a folder to oneDrive without moving the folder to the oneDrive folder in windows 10

I wanted to find out if it is possible to link my htdocs folder (which is not located in oneDrive) to oneDrive so that it will be synced without necessarily moving the folder to oneDrive. It will kind of like a copy mirroring the original htdocs folder. Changes made in the original folder will be updated in the second folder.

2

4 Answers

You can use the following command to do so, linking Pictures to new_folder, and OneDrive will start to sync the contents of Pictures:

Mklink /j "%UserProfile%\OneDrive\Documents\new_folder" "H:\Documents\Pictures"
4

Don't know if you have checked my solution to this issue yet, but I believe would worth your time, it is open source and free here:

Essentially it is an app that provides you a nice GUI based symbolic link creation and periodically "bully"/trick OneDrive to scan and sync changes in all symlinked folders by renaming an empty file in the root folder of OneDrive.

Thanks,

1

Same solution using modern Windows command line:

Open "Windows PowerShell":

New-Item -ItemType Junction -Path "$env:OneDrive\Documents\new_folder" -Target "H:\Documents\Pictures"

Explanation: This creates a new folder link or junction point, as Microsoft calls it, within your OneDrive folder. This link is like a pointer so the content of "H:\Documents\Pictures" can also be accessed like if it exist in OneDrive\Documents\new_folder.

1

Finally got this method to work, however a step seems to have been omitted (or unclear). The "%UserProfile%" refers to the "%CompletePath%" to the UserProfile uncluding "%C:\Users(UserProfile)%"

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like