windows最大路径限制

在 Windows API 中,路径的最大长度为 MAX_PATH,此项被定义为 260 个字符;

解决方案:

  点击查看详情: 最大路径长度限制 - Win32 apps | Microsoft Learn

  1.修改注册表值(windows+R 输入 regedit )

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem  里面的项 LongPathsEnabled 值设置为1

  2.应用程序清单还必须包含 longPathAware 元素

<application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
        <ws2:longPathAware>true</ws2:longPathAware>
    </windowsSettings>
</application>

 

posted @ 2024-12-05 15:49  Hi.wz  阅读(87)  评论(0)    收藏  举报