use junction command

by spadeskingtx - 3/9/13 12:15 AM

In Reply to: To GEO2003 by LairdDrambeg

you can use the junction command to effectively relocate any directory on one drive to any directory on a different drive. For example you want to keep your music on a different drive.

Say the normal path might be c:\users\whomever\music
and you want to actually store your music on a drive assigned letter M.
Simply follow these steps...
go to drive m with m:
cd \
mkdir music
Then run the following command
junction c:\users\whomever\music M:\music

Now copy your music to m:\music
Whenever an application including windows itself looks at c:\users\whomever\music it will look at M:\music and it will be transparent that the data physically resides somewhere else.
dir c:\users\whomever\music\*.* returns the same as dir M:\music\*.*

Here is the hepl usage verbiage.

P:\>junction /?

Junction v1.05 - Windows junction creator and reparse point viewer
Copyright (C) 2000-2007 Mark Russinovich
Systems Internals -

The first usage is for displaying reparse point information, and the
second usage is for creating or deleting a NTFS junction point:

usage: junction [-s] [-q] <file or directory>
-q Don't print error messages (quiet)

-s Recurse subdirectories

usage: junction [-d] <junction directory> [<junction target>]
-d Delete the specified junction
example: junction d:\link c:\winnt