Windows: File path character limitJanuary 29, 2013
Based on a tip I recently wrote for my work colleagues.
I’ve substituted any identifying information with strings of x’s for the number of characters in the real examples from this workplace.
Long file paths are often the reason for getting an error message when you try to add a new file to a folder for which you have access permission.
- The total file path length in Windows cannot exceed 260 characters; it may be somewhere between 248 and 260 (see links below). This is a Windows limit and cannot be changed by you or anyone else.
- The file path length includes the drive name (network or local), the folder name(s), PLUS the file name.
- ‘Characters’ include spaces, punctuation marks, and underscores as well as letters and numbers.
- Quick fact: You can’t use any of these characters in a file or folder name: \ / ? : * ” > < | Again, this is a Windows limitation.
Let’s take a look at an example of a long file path:
\\xxxxxxxxxxxxxxx.xxxxx.xxxxxxxxxxxxx.xxx\share\xxxxxx xxxx\xxx\Regulatory Approvals\xxxxxxxxxxx xxxxxxxxxxxx\xxxxx xxxxxxxxxxxx\xx.xxx. xx xxxxx xxxxxxxx xxx\Rev 2 – Amendment 2\RO Brine Discharge EMMP_Rev 2, Amendment 2 (includes Amend 1 text) (draft).docx
There are 260 characters (including the \ separator) in this path, of which some 181 characters are used for the folder path (i.e. without the file name). Remember, every space is a character, every dot, letter, number, parentheses, underscore, is a character. I don’t think the \ separators are counted, but I’m not 100% sure. Without the \ separators, this path is still 251 characters long, so there’s not a lot of room for increasing the file name, changing the folder names, or adding a further folder level.
So how might you reduce the file name while keeping meaning and without compromising the folder names? The current file name ‘RO Brine Discharge EMMP_Rev 2, Amendment 2 (includes Amend 1 text) (draft).docx’ uses 79 characters; it could become any of these:
- ‘RO Brine Discharge EMMP Rev 2 Amend 2 (incl Amend 1) (draft).docx’ (65 characters), or
- ‘RO Brine Discharge EMMP Rev 2 Amend 2 (incl Amend 1).docx’ (57 characters), or
- ‘RO Brine Discharge EMMP Rev 2 Amend 2.docx’ (42 characters, almost half the original file name).
To reduce the number of characters for ALL file paths in this folder, the folder name could be ‘Rev 2 Amend 2’ (13 characters) instead of ‘Rev 2 – Amendment 2’ (19 characters). NOTE: Only rename folders at the time you create the folder. DO NOT change existing folder names without consulting others – many people have shortcuts set to network folders and if you change the folder name in any way (add a space or underscore, fix a typo, etc.) then their links will break and they will not be happy with you.
- From one of the Microsoft Forums (http://answers.microsoft.com/en-us/windows/forum/windows_7-files/how-do-i-change-how-long-file-folder-names-can-be/cfb58a04-1efc-41ac-a4df-178825ca7ae1): ‘You cannot change the limit on the length of the path. It is imposed by various requirements and is hard coded into the system. You can adjust the “balance” as between file and folder/sub-folder names. E.g., use short directory names so you can use longer file names. … All of this can be a nuisance to the user. A file name can be OK when originally created but prove too long if the file is to be copied or moved to a different location whose path is longer. … There can be additional complications if files are to be burned to DVD or CD.’
- http://windows.microsoft.com/is-IS/windows7/File-names-and-file-name-extensions-frequently-asked-questions (while this article focuses on Windows 7, it equally applies to Windows Vista)
(By the way, in case you were wondering… I didn’t count every character manually! I got character counts for each of these file paths by copying the file path into Word 2007, selecting the text, then clicking Word Count on the Review tab.)