![windows符号链接](https://i-blog.csdnimg.cn/blog_migrate/5c42864d10ff0e43e7383d968a1dd219.png)
windows符号链接
![why-does-windows-continue-using-shortcut-files-instead-of-symbolic-links-00](https://i-blog.csdnimg.cn/blog_migrate/f549a9c576b4a07768fa03b2f2209f86.png)
Since Windows has continued to evolve and add more functionality over time, you may find yourself curious as to why it continues to use older “features” like shortcut files. With that in mind, today’s SuperUser Q&A post has answers to a confused reader’s questions.
由于Windows不断发展并随着时间的推移增加了更多功能,因此您可能会好奇为什么它继续使用快捷方式文件等较旧的“功能”。 考虑到这一点,今天的SuperUser Q&A帖子回答了一个困惑的读者的问题。
Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.
今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。
问题 (The Question)
SuperUser reader Peter Mortensen wants to know why Windows continues to use shortcut files instead of symbolic links:
超级用户读者Peter Mortensen想知道为什么Windows继续使用快捷方式文件而不是符号链接:
Windows XP and later versions support symbolic links, yet Windows continues to use shortcut files (which essentially store the location of the linked file as text). Why?
Windows XP和更高版本支持符号链接,但是Windows继续使用快捷方式文件(本质上将链接文件的位置存储为文本)。 为什么?
Why does Windows continue to use shortcut files instead of symbolic links?
为什么Windows继续使用快捷方式文件而不是符号链接?
答案 (The Answer)
SuperUser contributor Jonno has the answer for us:
超级用户贡献者Jonno为我们提供了答案:
There are a number of reasons. For example:
有很多原因。 例如:
- You can store different levels of compatibility against several different shortcuts to the same exe file as they are interpreted by the shell, rather than the file system. 您可以针对外壳程序而不是文件系统解释的同一个exe文件的几种不同快捷方式存储不同级别的兼容性。
- Certain shortcut links do not actually exist in the file system. Some of them are simply references to GUIDs or special strings interpreted by the shell. 文件系统中实际上并不存在某些快捷方式链接。 其中一些只是对GUID的引用,或者由Shell解释的特殊字符串。
- You cannot include switches in a symbolic link. Sure, you can point to the exe file, but you cannot “tell” that exe file any further arguments. 您不能在符号链接中包含开关。 当然,您可以指向exe文件,但不能“告诉”该exe文件任何其他参数。
- You cannot choose an icon for a symbolic link. 您不能为符号链接选择图标。
- You cannot choose what directory to work from in a symbolic link. 您不能从符号链接中选择要使用的目录。
- Shortcut files do not have to point to just files, they can also be hyperlinks or protocol links (like .URL files). 快捷方式文件不必仅指向文件,它们还可以是超链接或协议链接(例如.URL文件)。
- LNK files can exist on any file system. Symbolic links are handled by the file system itself, in the case of Windows, NTFS. LNK文件可以存在于任何文件系统上。 在Windows NTFS中,符号链接由文件系统本身处理。
- There is no real need to replace them. They work, are tiny in size, and can be scaled up in the future should there ever be a need for more functionality to be added to them than what is already listed above. 确实没有必要替换它们。 它们可以工作,体积很小,并且如果需要添加比上面已经列出的功能更多的功能,可以在将来进行扩展。
- Administrative rights are required to create a symbolic link (with good reason), otherwise redirection of innocent files to malicious ones can be executed with very little work. 创建符号链接需要有管理权限(有充分的理由),否则,只需很少的工作即可执行将无害文件重定向到恶意文件的操作。
There are more reasons than this, but I think this is enough to get you started. Here is an MSDN blog link provided by grawity that provides more information about parts of this topic.
除此之外,还有更多原因,但是我认为这足以帮助您入门。 这是grawity提供的MSDN博客链接 ,其中提供了有关此主题各部分的更多信息。
Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.
有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程 。
windows符号链接