Problem
I’ve been using c:\work folder forever to store my work related semi-temporary files on my laptop hard drive. Although losing contents of that folder due to hard drive issue or similar wouldn’t cause much downtime in my work (as all important files are stored in the cloud), I still didn’t feel too relaxed with the possibility of losing even 5 minutes of work in case that folder somehow disappeared.Few times I’ve decided to move my c:\work to OneDrive for Business folder in order to sync work related files automatically to business version of OneDrive hosted in Office 365. However, each time I’ve got frustrated by the fact that finding the OneDrive folder in File Explorer is so difficult.
Sure, using Favorites or Quick Access (as in Windows 10), I can get there pretty easily, but still, it will add at least one additional folder level and lots of clikety clicks with my tired little mouse to get where I want to go. Plus, just looking at the left pane in File Explorer that is so full with items (several instances of OneDrive, DLNA devices just below This PC, Control Panel?!, yet again same libraries, Desktop items at the root, Music, Videos, Pictures, etc.) makes me want to cry.
Solution
Use junction points to direct content from c:\work into your OneDrive folder, such as C:\Users\Jussi\OneDrive - Sulava Oy\Work. After creating junction point such as this, all content you add to c:\work will actually reside in the OneDrive folder, and are synced to OneDrive normally. And best of all, I can still use c:\work like I’ve always used.Steps how to do this:
- Open Command Prompt
- Type in mklink /j c:\Work "C:\Users\Jussi\OneDrive - Sulava Oy\Work"
- Rename your existing c:\work (or whatever your folder is called) to e.g., c:\work_old
- Create Work folder into the OneDrive folder, e.g., C:\Users\Jussi\OneDrive - Sulava Oy\Work
- Open Command Prompt
- Type in mklink /j c:\Work "C:\Users\Jussi\OneDrive - Sulava Oy\Work"
- Move old content from c:\work_old to c:\work and confirm that Work folder under OneDrive folder starts syncing and eventually goes green
I have changed the content of the files and it did NOT update to OneDrive
ReplyDeleteIn your Work folder, confirm you see the change. Then confirm you see the change in your local Onedrive folder. If not, the junction point was not setup correctly. If yes, theis Onedrive sync is not working.
DeleteYes you reversed source with destination - practically the real folder is in OneDrive and the link is on c:work ...... is this what you really wont ?!?!?
ReplyDeleteIndeed, real folder is in Onedrive and c:) work is just pointing to that real Onedrive folder.
DeleteDoes the order matter? Would this have the same result?
Delete>mklink /j "C:\Users\Jussi\OneDrive - Sulava Oy\Work" "c:\Work"
No, the syntax is mklink [[/d] | [/h] | [/j]] {Link} {Target}, so first you need to define where you want the new folder to be (Link), and only after that where it is really pointing to (Target).
DeleteThank you!!!!!!!!!!!!!!!!!!!!!!!!! It worked very fine in W10!!
ReplyDeleteWhat is the difference or the better way: Using a Junction (/J) or a Symbolic Link (/D)? I'm using Windows 10.
ReplyDeleteIn this case both should work as you're working winin your computer, difference between the two is more relevant if the junction/symlink target is file share on some other computer. Some deeper discussion on this can be found here: http://superuser.com/questions/343074/directory-junction-vs-directory-symbolic-link
DeleteDoes this result in a true two way sync?
ReplyDeleteYes, two way sync works fine with this solution.
DeleteThanks for your good command.
ReplyDeleteBut when I create a link, link is successfully created in cmd, but when I try to open shortcut file in local drive, it gives" access is denied, file name,directory or syntax is invalid".
Hi, hard to say what could be causing it. By "link" do you mean the junction point? If by "link" you mean shortcut file link, then it might be that those are not supported, normal files work fine though.
DeleteThe initial MOVE and Rename is not of any value, you can simply place a Junction (or sym Link) directly into the one drive folder to accomplish this.
ReplyDeleteIE change this to one Step:
1) Type in mklink /j "C:\Users\Jussi\OneDrive - Sulava Oy\Work" "c:\Work"
Thanks, apparently something has changed in more recent versions of Windows as you can now point it to an existing folder. Instructions updated.
DeleteI've just done this and it syncs perfectly. My question is if the original folder gets deleted, does the folder in OneDrive with all it's content get deleted as well?
ReplyDeleteIf you delete the ORIGINAL folder, i.e., "C:\Users\Jussi\OneDrive - Sulava Oy\Work" in my case, it will be deleted from OneDrive. If you delete the junction point, i.e., "c:\work", it will just delete the junction point and the actual folder will remain intact.
DeleteI tried the above, the link is created and I can see a green check mark on each folder , yet the files are not synching with one drive any thoughts?
ReplyDeleteIf you just did it. Maybe wait a few minutes depending on how much file you have. If nothing happens after a while then maybe delete it and try the process again.
DeleteI left it overnight and nothing...~80GB
DeleteHi,
ReplyDeleteinstead of "work" was planning to use this idea to keep back-up of personal staff (located in FAT32 / SD-card),which I don\t want to be on C-drive.
So on CMD made "mklink /j D:\Omat "C:\Users\xxxxxx\OneDrive - xxx\SD-card-Omat" "
This created error "Local NTFS volumes required to complete the operation".
As would like to keep as FAT32 (to avoid complications when using in other PC), any workaround in mind?
Thanks in advance
Esa
Junction point is NTFS feature and I'm not aware of any workaround for FAT32. :(
ReplyDeleteHello, you have bad syntax, both target and link should be in apostrophes.
ReplyDeleteApostrophes are not needed if the path doesn't contain spaces.
Delete