当您使用网络上的共享资源时,您可能需要快速获取到共享网络文件夹的链接并将其粘贴到聊天窗口中。或者,例如,您可能想知道如何创建指向本地存储在计算机上的文件的超链接,并使用它与您 PC 的其他用户共享该文件。尽管弄清楚如何操作并不容易,但Windows 11和Windows 10都允许您将文件路径复制为链接,并创建指向文件夹甚至库的链接。事不宜迟,以下是“如何创建文件或文件夹的链接?”等问题的答案。(“How do I create a link to a file or folder?”)和“如何将文件路径复制为链接?” (“How do I copy a file path as a link?”):
注意:(NOTE:)本指南涵盖Windows 11 和Windows 10。在两个操作系统中一切都一样。如果您不知道您的Windows版本是什么,请阅读:如何辨别我拥有的 Windows(11 种方式)(How to tell what Windows I have (11 ways))。
方法 1:如何使用共享向导在(Sharing Wizard)Windows中创建指向文件、文件夹或库的链接(Windows)
如果要创建指向文件、文件夹或库的链接,可以使用共享向导(Sharing Wizard)。此向导在Windows 11(Windows 11)和Windows 10中默认启用。但是,在Windows 10中,它适用于我们提到的所有项目,包括文件,在Windows 11中,您只能将它用于文件夹和库。要了解有关它的更多信息,请阅读本指南并按照它共享文件、文件夹或库:如何在 Windows 中与网络共享文件夹、文件和库(How to share folders, files, and libraries with the network, in Windows)。本质上,您需要做的是打开文件资源管理器(File Explorer),导航到要超链接的文件、文件夹或库,然后右键单击它以查看其上下文菜单。那么,如果你在Windows 10,选择“授予访问权限”(“Give access to” )并单击或点击特定人员(Specific people)。如果您使用的是Windows 11,请单击“显示更多选项”(“Show more options”),然后才转到“Give access to > Specific people.”
如何启动共享向导
按照共享向导的步骤进行操作,并且在该过程的最后一步中,当它通知您文件、文件夹或库已共享时,请不要关闭该向导。
Windows 11 中的共享向导
仔细查看“Your file/folder/library is shared”通知下方。在那里,Windows说“你可以通过电子邮件向某人发送这些共享项目的链接,或者将链接复制并粘贴到另一个应用程序中。”(“You can e-mail someone links to these shared items, or copy and paste the links into another app.”)
共享向导最后一步中的电子邮件和复制链接
如果您单击或点击电子邮件(e-mail)链接,您的默认电子邮件客户端会打开,并且直接链接会自动粘贴到新邮件中。这就是通过电子邮件发送文件链接的方法。
发送包含共享文件链接的电子邮件
如果您点击“复制”(“copy”)链接,共享资源的链接将被复制到剪贴板(copied to the clipboard),然后您可以将其粘贴(paste it)到其他程序中。
复制并粘贴共享文件链接
方法 2:如何使用文件资源管理器创建指向共享驱动器上的文件、文件夹或库的链接(File Explorer)
第二种方法适用于已在Windows计算机上共享的文件、文件夹和库。如果您想知道如何创建指向共享驱动器上文件的链接,此方法也适用。
打开文件资源管理器(File Explorer)(Open File Explorer),转到网络(Network)部分,然后双击或双击存储要链接的文件、文件夹或库的 PC。
来自本地网络的计算机/存储设备
这将向您显示与网络共享的所有文件夹的列表。浏览(Browse)直到找到您想要直接链接的特定文件、文件夹或库。
网络设备上共享的文件夹和文件
如果您使用的是Windows 10,请按住键盘上的Shift并右键单击您想要链接的文件、文件夹或库。如果您使用的是Windows 11,只需右键单击它。然后,在上下文菜单中选择“复制为路径” 。(“Copy as path”)
(Copy)在文件资源管理器中(File Explorer)复制文件的路径
或者,在Windows 10中,您还可以选择项目(文件、文件夹、库),然后单击或点击Windows 10 中文件资源管理器的“(File Explorer’s)主页”选项卡中的(Home)“复制为路径”(“Copy as path”)按钮。
(Copy)在 Windows 10 上的文件资源管理器中(File Explorer)复制文件的路径
在 Windows 11 中,按顶部工具栏中的查看更多(See more )(三点按钮),然后从显示的菜单中选择复制路径。(Copy path)
(Copy)在 Windows 11 上的文件资源管理器中(File Explorer)复制文件的路径
然后,将链接粘贴到您需要它的应用程序或文档中。您应该有类似以下内容:
将文件链接复制并粘贴到文档中
要使文件夹、库或文件链接处于活动状态,请按Enter以使其在复制它的Office应用程序中可单击。(Office)当您Ctrl + click该链接时,如果共享该资源的网络计算机可用,文件资源管理器将打开共享文件、文件夹或库。(File Explorer)
使文件链接可点击
我的文件路径链接不起作用!为什么?
在某些情况下,您创建的文件链接可能不起作用。有几个可能的原因。以下是您可以尝试的方法:
无论(Regardless)您是要创建指向文件、文件夹还是库的链接,在某些应用程序中,您都可能需要在网络路径前输入“file:///”,如下所示:
文件链接以单词文件开头,后跟下面的符号
在其他情况下,根据您要放置文件链接的应用程序,您可能还必须手动将链接路径中的所有空格替换为以下文本:%20。这是一个例子:
空格可以替换为 %20 编码
在某些旧版本的Windows或其他操作系统中,也有可能无法识别网络路径中的反斜杠。在这种情况下,您可以尝试将所有反斜杠 () 替换为正斜杠 (/)。
反斜杠可以替换为正斜杠
最后,请注意,无论您做什么,在某些应用程序中,文件链接都不能作为常规链接使用。大多数网络浏览器和聊天应用程序就是这种情况,它们将这些本地链接视为安全威胁。但是,即便如此,获取文件链接的用户仍然可以使用该链接访问该文件、文件夹或库。他或她所要做的就是将链接复制并粘贴到(他或她)文件资源管理器(File Explorer)的地址栏中,然后按Enter。
在文件资源管理器的地址栏中复制并粘贴文件链接
你使用文件超链接吗?
我们希望您发现这些提示很有用。如果您知道生成指向网络中共享的文件、文件夹或库的链接的其他方法,请随时告诉我们。下方评论(Comment),让我们分享所有在Windows中生成链接的方法。
How to create a link to a file or folder in Windows (2 ways) -
When you work with shared resources on a network, you may need to quickly get the link to a shared network folder and рaste it into a сhat window. Or, for example, уou might want tо know how to create a hyperlink to a file stored locally on your computer and use it to share that file with other users of your PC. Although it’s not exactly еasy to figure out how, both Windows 11 and Windows 10 allow you to copy a file path as a lіnk and to create lіnks to a folder or еven a library. Without further ado, here are the answers to queѕtions like “How do I create a link to a file or folder?” and “How do I copy a file path as a link?”:
NOTE: This guide covers Windows 11 and Windows 10. Everything works the same in both operating systems. If you don’t know what your version of Windows is, read: How to tell what Windows I have (11 ways).
Method 1: How to create a link to a file, folder, or library in Windows using the Sharing Wizard
If you want to create a link to a file, folder, or library, you can use the Sharing Wizard. This wizard is enabled by default, both in Windows 11 and Windows 10. However, while in Windows 10, it works for all the items we mentioned, including files, in Windows 11, you can only use it for folders and libraries. To learn more about it, read this guide and follow it to share files, folders, or libraries: How to share folders, files, and libraries with the network, in Windows. Essentially, what you need to do is open File Explorer, navigate to the file, folder, or library you want to hyperlink, and right-click on it to see its context menu. Then, if you’re on Windows 10, select “Give access to” and click or tap on Specific people. If you’re using Windows 11, click “Show more options”, and only then go to “Give access to > Specific people.”
How to start the sharing wizard
Follow the steps of the sharing wizard and, during the final step of the process, when it informs you that the file, folder, or library is shared, don’t close the wizard.
The sharing wizard from Windows 11
Look carefully beneath the “Your file/folder/library is shared” notification. There, Windows says that “You can e-mail someone links to these shared items, or copy and paste the links into another app.”
The e-mail and copy links from the last step of the sharing wizard
If you click or tap the e-mail link, your default email client is opened, and the direct link is automatically pasted into a new message. And that’s how to send a link to a file via email.
Sending an email with the shared file link
If you press the “copy” link, the link to the shared resource is copied to the clipboard, and you can then paste it into other programs.
Copy and paste a shared file link
Method 2: How to create a link to a file, folder, or library on a shared drive using File Explorer
The second method applies to files, folders, and libraries that you’ve already shared on your Windows computer. If you’re wondering how to create a link to a file on a shared drive, this method works for that too.
Open File Explorer, go to the Network section, and double-click or double-tap on the PC that stores the file, folder, or library you want to link.
A computer/storage device from the local network
This shows you a list of all the folders that are shared with the network. Browse until you find the specific file, folder, or library for which you want the direct link.
The folders and files shared on a network device
If you’re using Windows 10, hold down Shift on your keyboard and right-click on the file, folder, or library for which you want a link. If you’re using Windows 11, simply right-click on it. Then, select “Copy as path” in the contextual menu.
Copy path for a file in File Explorer
Alternatively, in Windows 10, you can also select the item (file, folder, library) and click or tap on the “Copy as path” button from File Explorer’s Home tab in Windows 10.
Copy path for a file in File Explorer, on Windows 10
In Windows 11, press See more (the three-dot button) from the top toolbar and select Copy path from the menu displayed.
Copy path for a file in File Explorer, on Windows 11
Then, paste the link into the app or document you need it in. You should have something similar to this:
Copy and paste the file link in a document
For the folder, library, or file link(s) to be active, press Enter to make it clickable in the Office application where you copied it. When you Ctrl + click the link, File Explorer opens the shared file, folder, or library, if the network computer sharing that resource is available.
Making the file link clickable
My file path link doesn’t work! Why?
In some cases, the file links you create might not work. There are several possible causes. Here’s what you can try:
Regardless of whether you wanted to create a link to a file, folder, or library, in some apps, you might have to type “file:///” before the network path, like this:
The file link starts with the word file followed by the signs below
In other cases, depending on the apps in which you want to place the file links, you might also have to manually replace all the blank spaces in the link paths with this text: %20. Here’s an example:
Blank spaces can be replaced with %20 encodings
There’s also the possibility that on some older versions of Windows, or in other operating systems, the backslashes from the network paths aren’t recognized. In that case, you can try to replace all the backslashes (\) with forward slashes (/).
Backslashes can be replaced by forwarding slashes
Finally, note that, whatever you do, in some apps, file links simply don’t work as regular links. Such is the case with most web browsers and chat apps, which treat these local links as security threats. However, even so, the user who gets your file link can still use the link to get to that file, folder, or library. All he or she has to do is copy and paste the link in the address bar of (his or her) File Explorer and press Enter.
Copy and paste a file link in File Explorer’s address bar
Do you use file hyperlinks?
We hope that you’ve found these tips useful. If you know other ways to generate the link to the files, folders, or libraries shared in a network, don’t hesitate to let us know. Comment below, and let’s share all the ways to generate links in Windows.