Saturday, 23 April 2016

How to seamlessly move your Downloads folder to another drive

Recently Windows notified me that my primary hard drive was almost full.
My laptop has two hard drives:
  • C: 250 GB Samsung SSD and
  • D: 750 GB mechanical Toshiba.
Since most of the space in C: was occupied by downloads, I decided to move the %USERPROFILE%\Downloads folder to D:

Instead of just moving all the contents to another folder in D:, I substituted the actual folder with a symbolic link. This means that all the future downloads will be stored directly in D:.

> D:
> mkdir Downloads
> robocopy %userprofile%\Downloads Downloads /MIR /MT
> C:
> cd %userprofile%
> rmdir /S Downloads
> mklink /J Downloads D:\Downloads

That's it! mklink is the command to create links using NTFS features.
The /J option asks to create a NTFS junction that is, in fact, a symbolic link to a folder. The advantage of a junction point over a regular symbolic link is that it can "trick" application to believe it a regular folder.
NTFS does not support hard links to folders


No comments:

Post a comment