一半君的总结纸

听话只听一半君

How to create symbolic link in windows 7

To create symbolic link in windows 7,then easiest way is to use command mklink.
这个何时用到?比如当你有个文件夹放在C:\xyz 已经很久了,由于某个原因你不想去移他,但是你又希望他被装在D:\Dropbox的网盘同步,你可以用这个功能在D:\Dropbox加一个“快捷方式”指向c:\xyz.(其实这就是Linux的ln -s类似物,又叫symbolic link(soft))

C:\Windows\system32>mklink
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

/D      Creates a directory symbolic link.  Default is a file
symbolic link.
/H      Creates a hard link instead of a symbolic link.
/J      Creates a Directory Junction.
Link    specifies the new symbolic link name.
Target  specifies the path (relative or absolute) that the new link
refers to.

Normally,we can use the option /D to create symbolic link.
Note:You need the admin privileges to run this command
runcmdasadmin-376x450
Example:

To create a symbolic link named MyDocs from the root directory to the \Users\User1\Documents directory, type:

mklink /D \MyDocs \Users\User1\Documents

Also we can use junction.exe or linkd.exe to create symbolic link in windows 7,you can  try them after put them to C:\windows\system32  if you have the interest.

人肉备份自How to create symbolic link in windows 7

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: