Redirect folder on one HDD to a folder on another HDD
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.
Related videos on Youtube
xxbbcc
Updated on September 18, 2022Comments
-
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) andD:
(a regular hard drive). I'd like to keep some files onC:
but transparently access those files through theD:
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 virtualX:
drive, usingsubst X: D:\X_Drive
.X:\Source
- when I go into this folder, I'd to see the contents ofC:\Source
.
Effectively, I'm looking for a way to map
D:\X_Drive
toC:\Source
. How can I do this? I have Windows 7 Ultimate. -
Hasan Manzak over 12 yearsFor the asker, there is also a Wikipedia article you should check out when it comes directory deleting with junctions, here
-
mtone over 12 years@The_aLiEn Thanks, I wasn't sure if rmdir was safe in XP, and apparently it is.
-
Chris Moschini over 3 yearsTo 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