top of page

Dealing with the 255 character limit for file paths in Windows

It's a well know fact that Windows restricts file paths to 255 characters (or 260 if you count the drive letter, a colon, a back slash, and null value at the end of the path). When you are organizing PDFs or other files in network folders with lots of subfolder levels, and long file names to indicate the dates and detailed descriptions of documents, you may wish you could get around this limit. The 255 limit actually applies to Windows Explorer, not most recent Windows operating systems. You can add a longer file name by assigning the folder with the long file names a drive letter.

1. See figure 1 below where we begin with a file name that's 249 characters long.

2. In figure 2 we try to create a sample text file with this full file name, in a folder that itself has 34 characters.

3. Review the resulting file name again in Excel using the LEN formula to check the character length, and you'll see that the file name has been truncated. See figure 3.

4. To deal with this problem go into the command prompt (type cmd in the search programs and files box in Windows) and then enter:

subst Y: C:\NewFoldertoHoldReallyLongFilePaths

. . . don't pick Y if it has already be assigned obviously. See figure 4.

5. Now in the resulting Y drive you will be able to copy in the full file name. See figures 5 and 6. The file will be present in the original folder, but must be opened from the Y drive.

bottom of page