Windows 7 file name length limited to 129 characters
In Windows the default total path length must not exceed 260 characters (drive
+ :\
+ 255 characters of filename
+ null terminator
+ probably for final \
in case the path is a directory or simply for even rounding). It was a relic from DOS's 8.3-name era where a 260-character path is a really deep path.
It's possible that your path to the folder was already very long, so the remaining part for your filename is just 129. If you want longer path, you have several solutions:
- use fully qualified file names with
\\?\
prefix, this way you can use maximum 32767 characters in the path‡ - rename the folders in the path to make it shorter
- mount the folder containing the file into a drive character with
subst
/mountvol
/diskmgmt.msc. This way you can use the maximum 255 characters for your file name - create a junction/symbolic link to another shallower folder on the path. You can't create links to drive letters, hence you can't achieve filenames as long as if you've used the mounting method
Since Windows 10 there's another option by removing MAX_PATH limitation§. You can enable it by setting HKLM\SYSTEM\CurrentControlSet\Control\FileSystem LongPathsEnabled
in registry or set Computer Configuration > Administrative Templates > System > Filesystem > Enable NTFS long paths in group policy
Read more:
- Why does the 260 character path length limit exist in Windows?
- MSDN - Naming Files, Paths, and Namespaces
‡The maximum path of 32,767 characters is approximate, because the
\\?\
prefix may be expanded to a longer string by the system at run time, and this expansion applies to the total length.§Starting in Windows 10, version 1607,
MAX_PATH
limitations have been removed from common Win32 file and directory functions. However, you must opt-in to the new behavior.
It is possible that you are exceeding a total of 260 characters for the entire pathname, including the backslash characters.
How many characters are in the path, including the name of the mp3 file?