"dir/a c \" Found a record in Windows 7
2009/07/14 12:53 Documents and Settings [C:\Users]
C:\Users is the original directory, C:\Documents and Settings is connected to C:\Users, perhaps Microsoft thought C:\Documents and Settings too long too difficult to remember, so in Windows 7/vista changed to C: \users, but also afraid of some old software compatibility problem, so leave a C:\Documents and Settings connection directory. This feature is similar to the link feature under Linux and is mklink.exe under Windows 7/vista.
Run Mklink under cmd/? To see the command help is shown below.
C:\>mklink
Creates a symbolic link.
MKLINK [[/d] | [H] | [/j]] Link Target
/d Creates a directory symbolic link. Default to File
Symbolic links.
/h creates a hard link instead of a symbolic link.
/j Create a directory join.
LINK Specifies the new symbolic link name.
TARGET specifies the path of the new link reference
(relative or absolute).
Attention:
A connection established using/d is similar to a soft connection under Linux and does not occupy storage space;
A connection established using/j is similar to a hard connection under Linux, occupying the same storage space as the same file;
Link and target folder content is exactly the same, if you make any one of the folders in the contents of the changes, the other will change accordingly. This feature was supposed to be in Windows 10 years ago, and it's a bit of a pity to be there today, but it's finally there. With this Mklink now Windows systems can also implement system files and user files separated.
The use of disk space by establishing symbolic links (symbolic) has not changed, because it is only the connection, not the original file copy and synchronization. Using the connected directory is like using the original directory, just like the actual directory, the program will not find the connection directory and the normal directory is different, this is the General folder shortcut is not possible.
Application Examples:
Suppose C: Disk space is not enough, we can move some of the software to D:\APP1 (when moving to ensure that the software does not have a file in the locked state of use), and then delete the C:\Program files\app1 directory, then do a to C:\Program files\ App1 The JUNCTION directory connection, the problem is solved satisfactorily. The command is: mklink/j "C:\Program files\app1" "D:\app1". This will release your C-space.
In fact, this stuff is very interesting, because sometimes you can use this way to create a very convenient way to access. For example, you put the directory you used to access so hard to connect to a directory, this way is different from the shortcut, it is the same as the real directory. Or you can connect directories of different partitions. This is how I can create a shared directory, the similar resources (in different partitions) hard to connect, why do this, because the original space is not enough, or file allocation problems.
More applications are also waiting to be explored slowly.
This article from "David's personal Blog" blog, reproduced please contact the author!