2021年1月20日 星期三

[研究] 解除 Windows 路徑最大長度260字元限制

[研究] 解除 Windows 路徑最大長度260字元限制

2021-01-20

在Windows 10版本1607之前的Windows版本中,路徑的最大長度是MAX_PATH,它定義為260個字符。在Windows的更高版本中,需要更改註冊表項或使用組策略工具才能刪除限制。

登錄機碼 (Registry key) 項目 Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD) 必須存在,並且設定為1。

許多 Windows API 函式具有 Unicode 版本,其允許大約 32,767 個字元的擴充長度路徑,也就是超過 MAX_PATH 設定所定義的 260 個字元路徑限制。

(完)

相關

NTFS 概觀 | Microsoft Docs
https://docs.microsoft.com/zh-tw/windows-server/storage/file-server/ntfs-overview

Naming Files, Paths, and Namespaces - Win32 apps | Microsoft Docs
https://docs.microsoft.com/ZH-TW/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN#maxpath

Maximum Path Length Limitation - Win32 apps | Microsoft Docs
https://docs.microsoft.com/ZH-TW/windows/win32/fileio/maximum-file-path-limitation

沒有留言:

張貼留言