Use symbolic links to sync folders outside of the Dropbox folder

Use symbolic links with Dropbox
mklink /D “%userprofile%\Dropbox\Documents” “%userprofile%\Documents”

I love using Dropbox but a down side is that I have files and folders outside of Dropbox that I would like to sync in Dropbox without moving them into the Dropbox folder. Luckily there is an easy to way to accomplish this. Windows has a built in function since windows vista to create symbolic links. Symbolic links take the idea of shortcuts one step further. Instead of just being a link to something somewhere else on your computer it tricks programs into thinking the files and folders actually reside inside the folder in which they are linked.  I will explain how to do this using the built in utility in Windows but there are several third party apps that do this for you using a graphical interface.
Don’t be scared this is easy and I explain everything below..

* Update * There is one glitch with symbolic links and Dropbox you should be aware of. Dropbox will only notice changes during the Dropbox service start up so changes will only be replicated when you login to your computer or when you restart the service. I will write a second tutorial on how to automatic the service shutdown/start up. If you want to sync your whole My Documents folder there is a much easier method that moves you entire documents folder into dropbox and then you should have no issues (this is the way Dropbox suggests you do it) but if you only want one folder or folders from multiple places on your computer to be in dropbox then you are stuck using symbolic links.

Symbolic Link Tutorial Starts Here:

In order to run the command you need in Windows 7 you need to open command prompt with elevated privileges. Click the start button and type cmd now right click click “Run as Administrator”.

CMD with elevated privileges

Now that you have command prompt open you just have to create the link using the command line tool called mklink. In mklink the first path you type in is the path into your dropbox folder where you want this link to be. The second path is where the real folder is located on your computer. Example: mklink /D “C:\Users\UserName\Documents\Dropbox\DesiredFolderName” “C:\Path\To\DesiredFolder”

In this real example a symbolic link to my documents folder is created in my dropbox folder. mklink /D “c:\users\matt\documents\dropbox\SLinkDocuments” “c:\users\matt\documents” so now I would have a folder in my dropbox folder called SlinkDocuments that is synced to all my computers and devices and tied to my actual documents folder on my computer.

In this example I use a veritable so that anyone can run this same command without changing it and it will create a symbolic link in their Dropbox folder to their Documents folder inside their profile.
mklink /D “%userprofile%\Dropbox\Documents” “%userprofile%\Documents”

How the above example works.

  • The mklink /D tells your computer to create a symbolic link.
  • The %userprofile% specifies the path to the currently logged on user’s profile such as C:\users\matt
  • Then I just fill in the rest of the path to the Dropbox folder \Dropbox\and then the name of the symbolic link Documents
  • The last part of this is the path to the currently logged on user’s Documents folder using the %userprofile% system variable again.
This entry was posted in Computers & Technology and tagged , , . Bookmark the permalink.