I have come across this issue while I was working on a project and at some point decided to sync my project folder on cloud. I already have cloud accounts with Google and Dropbox but unfortunately both work with default folders i.e. “Google Drive” and “Dropbox” respectively. It was absolutely not convenient for me to put my project folder in either of them. Specially when I wanted to sync my folder with both.
Then I google it to find out the solution to my problem. I have come across the term “NTFS Junction Point” which I never heard of before. After a little bit of research it sounded like the solution to my problem.
“An NTFS junction point is a feature of the NTFS file system that provides the ability to create a symbolic link to a directory which then functions as an alias of that directory. This has many benefits over aWindows shell shortcut (.lnk) file, such as allowing access to files within the directory via Windows Explorer, the Command Prompt, etc.”
well, to be honest I copied this definition from wikipedia so if you want to know more about it then click here.
Also the documentation about “mklink” (the command to create junction point) can be found here. This blog is to share the difficulties I came across due to the poor documentation about the use of these commands.
The command to create a junction point as stated on MS website is as follows:
mklink [/j] <Link> <Target>
where <link> is the junction point and the <target> is the original folder that is to be synchronised with Google or Dropbox.
There are couple of points which are very important to consider while creating a junction point. Let’s start with the basic one:
- Do not forget to use double quotes when <Link> or <Target> path contains spaces e.g. mklink /j “c:\dropbox\link folder” “c:\projects\target folder”
- make sure the “link folder” that you specified in the command does not already exist otherwise you will come across the error message “Cannot create a file when that file already exists”. This means mklink command will automatically create the “link folder” for you and will throw an exception if the folder already exists. Again “link folder” was non-existent and created by mklink command while “target folder” was the original folder with files and sub-folders in it.
NOTE: This workaround was tested only against Dropbox. GoogleDrive is included only on the basis of mere assumptions.
Hope this makes sense to you …. and if not then I don’t mind you to help me improving it 😉