Redirect folder on one HDD to a folder on another HDD

47,722

Junctions (also called symbolic links or reparse points) allows you to do that. You can use mklink in the command prompt (with /D for directory) to create them:

mklink /D C:\Source D:\Source

This will be transparent to applications - that is they will see it as a regular folder.

In Windows Vista/7, it is safe to delete C:\Source from Windows Explorer, or from the command prompt (del C:\Source) as it will only delete the link, without affecting the content of your target folder (D:\Source). However, in WinXP/2000 it would also delete the target content, so you should use rmdir, or the Sysinternal Junction utility in this case.

Share:
47,722

Related videos on Youtube

xxbbcc
Author by

xxbbcc

Updated on September 18, 2022

Comments

  • xxbbcc
    xxbbcc almost 2 years

    This may be a simple question but I couldn't find any answers - folder redirection usually refers to redirecting profile folders only.

    I have two hard drives in my laptop: C: (an SSD) and D: (a regular hard drive). I'd like to keep some files on C: but transparently access those files through the D: drive. For example, I'd like to have:

    • C:\Source - this is where I want my physical files to be stored.

    • D:\X_Drive - this folder is mapped to a virtual X: drive, using subst X: D:\X_Drive.

    • X:\Source - when I go into this folder, I'd to see the contents of C:\Source.

    Effectively, I'm looking for a way to map D:\X_Drive to C:\Source. How can I do this? I have Windows 7 Ultimate.

  • Hasan Manzak
    Hasan Manzak over 12 years
    For the asker, there is also a Wikipedia article you should check out when it comes directory deleting with junctions, here
  • mtone
    mtone over 12 years
    @The_aLiEn Thanks, I wasn't sure if rmdir was safe in XP, and apparently it is.
  • Chris Moschini
    Chris Moschini over 3 years
    To be clear, the mklink syntax for creating a new symbolic directory linked to an existing target, it's mklink /D (new path) (target path) like mklink /D C:\users\chris\.ssh C:\users\chris\dropbox\.ssh