首先说下软链接的含义, 这里的软链接不是指windows的快捷方式, 引用网友的一句话(有点抽象, 但很贴切):
软链接和快捷方式不是一个层次上的东西,前者是底层文件系统的功能,后者是应用层的功能。Windows 下目录的快捷方式用 dir 看起来是个文件。查看文件的属性就能看出软链接和快捷方式的不同
在Linux 系统中我们可以很方便的使用ln -s命令来建立软链接, 但在windows 7/xp/2003等不提供这个功能.
查阅网络资料时发现, Microsoft在之前发布的一个软件包-Windows Server 2003 Resource Kit Tools 中, 有个软件linkd提供这个功能:
Links an NTFS directory to a target valid object name in Windows 2000.
LINKD Source [/D] Destination
Source – Displays the Windows 2000 name targeted by Source
Source Destination – Links source directory to Destination directory or a
Windows 2000 device or any valid Windows 2000 name
Source /D – Deletes Source, regardless of whether a link exists at
source
/? – Prints this help message
LINKD grafts (links) the target name directly into the name space at Source,so that Source subsequently acts as a name space junction. The Source directory must reside on a disk formatted with NTFS in Windows 2000. The destination (the target of the link) can be any valid directory name or device name or valid object name in Windows 2000. When the target name does not resolve to a directory or a device, open calls fail.
虽然上面说在windows2000中, 但在xp下测试也是可以的, 安装完上面的软件包后, 可以通过命令来创建一个软链接, 命令如: linkd d:toolkit d:softwaremicrosoftwindowstoolkitTools 当出现下面的提示就是成功了~
Link created at: d:linkd
通过这个命令可以将一个很深的Tools目录软链接到d盘根目录下
PS: 这时你打开d:toolkit, 看看地址栏的地址你就很清楚跟快捷方式的区别的
删除这个软链接可以使用: linkd d:toolkit /D 出现”The delete operation succeeded.”提示则说明删除成功.
如果想使用linkd命令, 又不想下载那个软件包(11.8MB),可以下载下面的软件包~
linkd 下载
评论