One of the long-awaited features in Windows Vista was the ability to use symbolic links, the way you can in linux. Sadly, they don’t work quite as well as they could, but it’s a big upgrade from prior versions, and has solved a number of problems for me already.

Windows Vista中人们期待已久的功能之一就是能够使用符号链接,这是在Linux中的一种方式。 令人遗憾的是,它们的运行状况不尽如人意,但这是对先前版本的重大升级,并且已经为我解决了许多问题。

使用mklink命令 (Using the mklink Command)

The command that you need to use is mklink, which you’ll use from the command line. Just type it on the command line to see the options:

您需要使用的命令是mklink ,您将在命令行中使用它。 只需在命令行上输入即可查看选项:

C:\Users\geek>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.
C:\Users\geek>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.

For instance, if you wanted to make the folder C:\Users\Geek\TestFolder available from C:\TestFolder as well, you could use the following command.

例如,如果您还想使文件夹C:\ Users \ Geek \ TestFolder也可以从C:\ TestFolder使用,则可以使用以下命令。

C:\mklink /D C:\TestFolder C:\Users\Geek\TestFoldersymbolic link created for C:\TestFolder <<===>> C:\Users\Geek\TestFolder

C:\ mklink / DC:\ TestFolder C:\ Users \ Geek \ TestFolders为C:\ TestFolder创建的符号链接<< === >> C:\ Users \ Geek \ TestFolder

Now if you look in C:\TestFolder directory, you’ll see whatever files were in the other directory.

现在,如果您查看C:\ TestFolder目录,您将看到另一个目录中的所有文件。

了解选项。 (Understanding the Options.)

MKLINK link target

MKLINK链接目标

Using the command without any extra options creates a soft link to a file.

使用不带任何其他选项的命令会创建到文件的软链接。

/D creates a symbolic link, or a soft link.

/ D创建符号链接或软链接。

This essentially acts like a shortcut to a folder in prior versions of Windows, except you don’t have to use an actual shortcut.

在本质上,这与Windows早期版本中的文件夹快捷方式一样,除非您不必使用实际的快捷方式。

/H creates a hard link, which points directly to the file.

/ H创建一个硬链接,该链接直接指向该文件。

This option can’t be used for folders directly for some reason, you’ll have to use the next option.

由于某些原因,该选项不能直接用于文件夹,您必须使用下一个选项。

/J creates a “Directory Junction”

/ J创建一个“目录连接”

A Directory Junction is actually just a hard link to a directory. This is a feature that existed prior to Vista as well. If you are trying to symlink to a directory using a hard link, then you should use this option.

目录连接实际上只是到目录的硬链接。 这是Vista之前也存在的功能。 如果尝试使用硬链接符号链接到目录,则应使用此选项。

了解硬链接与软链接 (Understanding Hard vs Soft Links)

Hard Link

硬链接

A hard link directly points to the file, and acts to the operating system as if it is the file itself. You’ll want to use this option the majority of the time if you are trying to fake an application’s directory.

硬链接直接指向文件,并像文件本身一样作用于操作系统。 如果要伪造应用程序的目录,则通常需要使用此选项。

Soft Link

软链接

A soft link is essentially a shortcut to a file or folder – if you are using Windows explorer, you’ll be redirected to the directory if you double-click on a shortcut, it won’t pretend its part of the filesystem. You can still directly reference or open a file with the symlinked path, and it mostly works.

软链接本质上是指向文件或文件夹的快捷方式-如果您使用的是Windows资源管理器,则双击快捷方式将重定向到该目录,它不会伪装成文件系统的一部分。 您仍然可以直接使用符号链接的路径引用或打开文件,并且该文件大多数都可以使用。

使用网络共享中的符号链接 (Using Symlinks from a Network Share)

One of the things that’s been extensively discussed is that you cannot use the Vista symlinks from another operating system (not surprising), but you cannot use them from a network share either. This is troublesome if you expect to use this feature on a web server or a file server.

被广泛讨论的一件事是,您不能使用来自另一个操作系统的Vista符号链接(不足为奇),但是您也不能从网络共享中使用它们。 如果您希望在Web服务器或文件服务器上使用此功能,则很麻烦。

删除符号链接 (Deleting Symlinks)

To delete a symlink, you can just delete the link. Just make sure you don’t delete the original file.

要删除符号链接,您只需删除链接。 只要确保您不删除原始文件即可。

翻译自: https://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/

在Windows Vista中使用符号链接相关推荐

  1. bcdedit添加linux引导,Linux_利用Bcdedit创建Linux系统引导,Bcdedit在Windows Vista中的一个命 - phpStudy...

    利用Bcdedit创建Linux系统引导 Bcdedit在Windows Vista中的一个命令行工具,用于建立和重新配置bootloader,无须再使用boot.ini文件.下面我们来谈谈如何用bc ...

  2. ogm 算法_如何在Windows Vista中播放.OGM视频文件

    ogm 算法 So you've got a bunch of .OGM video files and they won't play in Windows Vista- relax, you ju ...

  3. c++ cleartype_在Windows Vista中调整ClearType字体设置

    c++ cleartype Many people have expressed to me their dislike of the default ClearType font smoothing ...

  4. Windows Vista中强大的数码相片处理功能(转)

    Windows Vista中强大的数码相片处理功能(转)[@more@] 有数码相机的人越来越多,因为拍摄成本低,所以很多人拍照的时候都是不假思索狂按快门,不知不觉中成百上千张相片就这样照出来了.可是 ...

  5. 如何在 Windows 恢复环境中使用 Bootrec.exe 工具解决和修复 Windows Vista 中的启动问题

    简介 <script type="text/javascript">loadTOCNode(1, 'summary');</script> 可以在 Wind ...

  6. Windows Vista中如何重置Winsock设置_Windows Vista_www.knowsky.com

    <script language='javascript' src='http://www.shiqiaotou.com/_header.js'></script> 在Wind ...

  7. 2003服务器文件自动只读,您不能查看或更改只读或文件夹在 Windows Server 2003、 Windows XP、 Windows Vista 中或在 Windows 7 中的系统属性...

    有关 Microsoft Windows 2000 中,Microsoft Windows NT 4.0. Microsoft Windows 操作系统版本,Microsoft Windows 98 ...

  8. 在Windows Vista中禁用混合睡眠模式

    Windows Vista has a neat new feature for laptops called "hybrid sleep".  Actually, Windows ...

  9. 戴尔服务器修改分辨率,戴尔Windows Vista 中设置显示分辨率的方法

    Windows Vista设置显示分辨率的方法和XP有一点不一样的地方,这里也介绍一下. 1.桌面的空白处点击鼠标右键,在弹出菜单中点开『个性化』. 2.在『个性化』设置窗口的最下方点开『显示设置』. ...

最新文章

  1. java增加缓存,java – 如何增加Integer对象的缓存大小
  2. 在html中三个图片切换,轻松搞定网页中的图片切换
  3. 过去10年技术人员有哪些状态改变?
  4. Hyper-V + CentOS7 网络设置(视频教程)
  5. .net core实践系列之短信服务-为什么选择.net core(开篇)
  6. java空心菱形_java 空心菱形
  7. Fortinet:行走在网络和安全融合领域的最前列
  8. linux命令kill百科,Linux 命令 kill
  9. 微信小程序wepy框架资源汇总
  10. 【latex】输入公式与编号
  11. python open w_Python输入,输出,存储器和异常
  12. BZOJ3233:[AHOI2013]找硬币(DP)
  13. 华为鸿蒙系统支持什么手机_华为手机支持升级鸿蒙OS的EMUI 11系统55款机型名单公布...
  14. angular toastr插件
  15. 手机的小窗口怎么弄_vivo怎么弄小窗口 vivo怎样弄小窗口
  16. html页面实现英中语言选择,js代码实现网站中英文相互翻译
  17. Keil C51 的printf
  18. 数据基础---《利用Python进行数据分析·第2版》第12章 pandas高级应用
  19. html内容被背景图片遮住怎么办_定义BODY背景图后,DIV的背景图片显示不全(已解决)...
  20. 极米movin01x和z6x的区别哪个好

热门文章

  1. python车牌识别逆光怎么办代码_这摄像头除了能逆光识别车牌,还会跟人打招呼?...
  2. linux第一章简答
  3. 使用xrandr和cvt命令添加自定义的分辨率模式
  4. C++基础学习一(基础之基础)
  5. HDU1561:The more, The Better——题解
  6. TMG学习(十一),保护企业内网上网安全
  7. linux系统的运行级别
  8. delphi 软件在线人数统计_8款值得学习的科研论文作图软件
  9. 基于.NET2.0的System.Net.Mail发送邮件Demo
  10. thinkpaidE480office安装文件夹