![wmp_top](https://i-blog.csdnimg.cn/blog_migrate/30bb03beb9e4d31b0225ddb2fe1a00ca.png)
With the Anniversary Update of Windows 10, you can finally abandon the 260 character maximum path limit in Windows. You just need to make a minor edit to the Windows Registry or Group Policy. Here’s how to make it happen.
借助Windows 10周年更新,您最终可以放弃Windows中260个字符的最大路径限制。 您只需要对Windows注册表或组策略进行较小的编辑。 这是实现它的方法。
Before Windows 95, Windows only allowed file names that were eight characters long, with a three character file extension–commonly known as an 8.3 filename. Windows 95 abandoned that to allow long file names, but still limited the maximum path length (which includes the full folder path and the file name) to 260 characters. That limit has been in place ever since. If you’ve ever run into this limit, most likely it was when you were trying to copy deep folder structures into other folders, such as when copying the contents of a hard drive to a folder on another drive. The Windows 10 Anniversary Update finally adds the option to abandon that maximum path length.
在Windows 95之前,Windows仅允许文件名长为八个字符,带有三个字符的文件扩展名(通常称为8.3文件名)。 Windows 95放弃了允许长文件名的规定,但仍将最大路径长度(包括完整的文件夹路径和文件名)限制为260个字符。 从那时起,这个限制就一直存在。 如果曾经遇到此限制,则很可能是当您尝试将深层文件夹结构复制到其他文件夹时,例如将硬盘驱动器的内容复制到另一个驱动器上的文件夹时。 Windows 10周年更新最终添加了放弃该最大路径长度的选项。
There is one caveat. This new setting won’t necessarily work with every application out there, but it will work with most. Specifically, any modern applications should be fine, as should all 64-bit applications. Older 32-bit applications need to be manifested in order to work, which really just means that the developer has indicated in the application’s manifest file that the application supports longer paths. Most popular 32-bit apps should experience no problem. Still, you don’t risk anything by trying the setting out. If an application doesn’t work, the only thing that will happen is that it won’t be able to open or save files that are saved in places where the full path exceeds 260 characters.
有一个警告。 此新设置不一定适用于所有应用程序,但适用于大多数应用程序。 具体来说,任何现代应用程序都应该不错,所有64位应用程序也应该如此。 较旧的32位应用程序需要显示才能正常工作,这实际上仅意味着开发人员已在应用程序的清单文件中指示该应用程序支持更长的路径。 最流行的32位应用程序应该没有问题。 不过,尝试设置不会让您冒险。 如果应用程序不起作用,唯一会发生的事情是它将无法打开或保存保存在完整路径超过260个字符的位置的文件。
家庭用户:通过编辑注册表删除260个字符路径限制 (Home Users: Remove the 260 Character Path Limit by Editing the Registry)
If you have a Windows Home edition, you will have to edit the Windows Registry to make these changes. You can also do it this way if you have Windows Pro or Enterprise, but feel more comfortable working in the Registry than Group Policy Editor. (If you have Pro or Enterprise, though, we recommend using the easier Group Policy Editor, as described in the next section.)
如果您使用的是Windows Home版本,则必须编辑Windows注册表才能进行这些更改。 如果您拥有Windows Pro或Enterprise,也可以通过这种方式进行操作,但是与组策略编辑器相比,在注册表中进行操作会更自在。 (但是,如果您具有Pro或Enterprise,我们建议使用更简单的组策略编辑器,如下一节所述。)
Standard warning: Registry Editor is a powerful tool and misusing it can render your system unstable or even inoperable. This is a pretty simple hack and as long as you stick to the instructions, you shouldn’t have any problems. That said, if you’ve never worked with it before, consider reading about how to use the Registry Editor before you get started. And definitely back up the Registry (and your computer!) before making changes.
标准警告:注册表编辑器是一个功能强大的工具,滥用它会使您的系统不稳定甚至无法运行。 这是一个非常简单的技巧,只要您按照说明进行操作,就不会有任何问题。 也就是说,如果您以前从未使用过它,请在开始之前考虑阅读有关如何使用注册表编辑器的信息。 并在进行更改之前一定要备份注册表(和您的计算机!)。
To get started, open the Registry Editor by hitting Start and typing “regedit.” Press Enter to open Registry Editor and give it permission to make changes to your PC.
首先,点击开始并键入“ regedit”,打开注册表编辑器。 按Enter键打开注册表编辑器,并授予其对PC进行更改的权限。
![wmp_1](https://i-blog.csdnimg.cn/blog_migrate/edc46b3378106e9a747f4cc4b47d70d0.png)
In the Registry Editor, use the left sidebar to navigate to the following key:
在注册表编辑器中,使用左侧边栏导航至以下键:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
![wmp_2](https://i-blog.csdnimg.cn/blog_migrate/a4ad465af20e0aa092f6d47a10dcea6f.png)
On the right, find a value named LongPathsEnabled
and double-click it. If you don’t see the value listed, you’ll need to create it by right-clicking the FileSystem
key, choosing New > DWORD (32-bit) Value, and then naming the new value LongPathsEnabled
.
在右侧,找到一个名为LongPathsEnabled
的值,然后双击它。 如果没有看到列出的值,则需要通过右键单击FileSystem
项,选择“新建”>“ DWORD(32位)值”,然后命名新值LongPathsEnabled
来创建它。
![wmp_3](https://i-blog.csdnimg.cn/blog_migrate/1ad8bf7450ff0e4c468f83143258e784.png)
In the value’s properties window, change the value from 0 to 1 in the “Value data” box and then click OK.
在值的属性窗口中,在“值数据”框中将值从0更改为1,然后单击“确定”。
![wmp_4](https://i-blog.csdnimg.cn/blog_migrate/1556a5cde8fd56cf2d4bd69b201703c6.png)
You can now close Registry Editor and restart your computer (or sign out of your account and sign back on). If you ever want to reverse the changes, just head back to the LongPathsEnabled
value and set it from 1 back to 0.
现在,您可以关闭注册表编辑器并重新启动计算机(或注销帐户并重新登录)。 如果您想撤消更改,只需回到LongPathsEnabled
值并将其从1设置回0。
下载我们的一键式注册表黑客 (Download Our One-Click Registry Hack)
![wmp_5](https://i-blog.csdnimg.cn/blog_migrate/2fca6ee1d7e89ee4972aa35fc78dd5d1.png)
If you don’t feel like diving into the Registry yourself, we’ve created two downloadable registry hacks you can use. One hack removes the 260 character path limit and the other hack restores the default limit. Both are included in the following ZIP file. Double-click the one you want to use, click through the prompts, and then restart your computer.
如果您不想自己进入注册表,我们创建了两个可供下载的注册表黑客。 一个hack会删除260个字符的路径限制,而另一个hack会恢复默认的限制。 两者都包含在以下ZIP文件中。 双击要使用的计算机,单击提示,然后重新启动计算机。
These hacks are really just the FileSystem
key, stripped down to the LongPathsEnabled
value we described above, and then exported to a .REG file. Running the “Remove 260 Character Path Limit” hack sets the LongPathsEnabled
value to 1. Running the “Restore 260 Character Path Limit (Default)” hack sets the value back to 0. And if you enjoy fiddling with the Registry, it’s worth taking the time to learn how to make your own Registry hacks.
这些黑客实际上只是FileSystem
密钥,被简化为我们上面描述的LongPathsEnabled
值,然后导出到.REG文件。 运行“删除260个字符路径限制” hack将LongPathsEnabled
值设置为1。运行“恢复260个字符路径限制(默认)” hack将值恢复为0。如果您喜欢使用注册表,则值得一试。是时候学习如何进行自己的注册表黑客了。
专业版和企业版用户:使用本地组策略编辑器删除260个字符路径限制 (Pro and Enterprise Users: Remove the 260 Character Path Limit with the Local Group Policy Editor)
If you’re using Windows 10 Pro or Enterprise, the easiest way to disable the new app install notifications is by using the Local Group Policy Editor. It’s a pretty powerful tool, so if you’ve never used it before, it’s worth taking some time to learn what it can do. Also, if you’re on a company network, do everyone a favor and check with your admin first. If your work computer is part of a domain, it’s also likely that it’s part of a domain group policy that will supersede the local group policy, anyway.
如果您使用的是Windows 10 Pro或Enterprise,则禁用新应用安装通知的最简单方法是使用“本地组策略编辑器”。 这是一个非常强大的工具,因此,如果您以前从未使用过它,那么值得花一些时间来学习它可以做什么。 另外,如果您在公司网络中,请给所有人一个帮助,并首先与您的管理员联系。 如果您的工作计算机是域的一部分,则它也很可能是域组策略的一部分,无论如何,该组策略将取代本地组策略。
In Windows 10 Pro or Enterprise, hit Start, type gpedit.msc, and press Enter.
在Windows 10 Pro或Enterprise中,单击“开始”,键入gpedit.msc,然后按Enter。
![gp_1](https://i-blog.csdnimg.cn/blog_migrate/f352385d974f69ac0ca6f6e385381170.png)
In the Local Group Policy Editor, in the left-hand pane, drill down to Computer Configuration > Administrative Templates > System > Filesystem. On the right, find the “Enable win32 long paths” item and double-click it.
在“本地组策略编辑器”的左侧窗格中,深入到“计算机配置”>“管理模板”>“系统”>“文件系统”。 在右侧,找到“启用win32长路径”并双击。
![gp_2](https://i-blog.csdnimg.cn/blog_migrate/1f813bc099c35afdcf73563ebfae8642.png)
In the properties window that opens, select the “Enabled” option and then click “OK.”
在打开的属性窗口中,选择“启用”选项,然后单击“确定”。
![gp_3](https://i-blog.csdnimg.cn/blog_migrate/e91040ac78aa9a8ca737cc04fef4fadd.png)
You can now exit the Local Group Policy Editor and restart your computer (or sign out and back in) to allow the changes to finish. If at any time you want to reverse the changes, just follow the same procedure and set that option back to “Disabled” or “Not Configured.”
现在,您可以退出本地组策略编辑器,然后重新启动计算机(或注销并重新登录),以完成更改。 如果您想随时撤消更改,只需按照相同的步骤,然后将该选项设置回“ Disabled”或“ Not Configured”即可。
The maximum path limit may not be something you’ve ever run into, but for some people it can certainly be the occasional frustration. Windows 10 has finally added the ability to remove that limit. You just have to make a quick change to the Registry or Group Policy to make it happen.
最大路径限制可能不是您曾经遇到过的问题,但是对于某些人来说,这当然可能是偶然的挫败感。 Windows 10终于添加了删除该限制的功能。 您只需对注册表或组策略进行快速更改即可实现。
翻译自: https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/