Max character limits for Windows...

ShepsCrook

[H]F Junkie
Joined
Feb 16, 2003
Messages
9,440
So the company I'm at has had poor management of their data storage structure. There are directories upon directories upon directories and long file character names that are reaching the Windows character limit. This is causing problems with permissions being changed (another story), as well as trying to clean up data like organizing the structure. It's gotten bad enough that I can't just go and rename the final file because of the character limit.

Is there any tool, application, or easy way to fix naming or at least move the files without renaming everything at this time?

For example, this would be one of the directory structures:

SHARE: PROJECTS
Dir: 2019 - Projects in progress
Sub Dir: 2019 - Our Company Name -Projects - R&D In Progress
Sub Sub Dir: 2019 - Our Company Abreviation RD Projects StupidClientnameCo
Sub Sub Sub Dir: StupidClientnameCo
Sub Sub Sub Sub Dir: 2019 - Design StupidClientnameCo
FileName: README - Bob, check the switch before you leave the inspections facility to disable the testing cooling system.txt
Contents: README - Bob, check the switch before you leave the inspections facility to disable the testing cooling system.txt

In some cases, there are shortcuts created going to a directory in the same directory that contains NO OTHER sub directories. So I think it's a black hole of directories.

Also:
Directories with parenthesis around things.... *sigh*
 
Last edited:
Sadly, I know of no easy way of dealing with this but I've seen this before. Several years ago I had to fix this manually. Eventually, I restructured things to prevent this. The other way I had done it was to manually assign permissions to the directories but I gave up on that fast. Once you start going too deep with directories and the directory / file names bump up against the character limits permissions propagation becomes a serious issue as you've stated.
 
NTFS actually has no problems with over 32000 chars in paths. It's the Window Explorer that fails beyond 260 characters (historical reasons). PS commands can handle long paths, so is Robocopy.
What I use as a replacement of Windows Explorer (as file manager) is XYplorer, it supports long filepaths, has tons and tons of features (small and big) that smashed my understanding about features in a file manager and made me no longer look at Explorer. Now over 10 years and counting.
 
NTFS actually has no problems with over 32000 chars in paths. It's the Window Explorer that fails beyond 260 characters (historical reasons). PS commands can handle long paths, so is Robocopy.
What I use as a replacement of Windows Explorer (as file manager) is XYplorer, it supports long filepaths, has tons and tons of features (small and big) that smashed my understanding about features in a file manager and made me no longer look at Explorer. Now over 10 years and counting.

I never thought this was specifically an NTFS problem as much as a Windows OS issue.
 
So the company I'm at has had poor management of their data storage structure. There are directories upon directories upon directories and long file character names that are reaching the Windows character limit. This is causing problems with permissions being changed (another story), as well as trying to clean up data like organizing the structure. It's gotten bad enough that I can't just go and rename the final file because of the character limit.

Is there any tool, application, or easy way to fix naming or at least move the files without renaming everything at this time?

For example, this would be one of the directory structures:

SHARE: PROJECTS
Dir: 2019 - Projects in progress
Sub Dir: 2019 - Our Company Name -Projects - R&D In Progress
Sub Sub Dir: 2019 - Our Company Abreviation RD Projects StupidClientnameCo
Sub Sub Sub Dir: StupidClientnameCo
Sub Sub Sub Sub Dir: 2019 - Design StupidClientnameCo
FileName: README - Bob, check the switch before you leave the inspections facility to disable the testing cooling system.txt
Contents: README - Bob, check the switch before you leave the inspections facility to disable the testing cooling system.txt

In some cases, there are shortcuts created going to a directory in the same directory that contains NO OTHER sub directories. So I think it's a black hole of directories.

Also:
Directories with parenthesis around things.... *sigh*


I have a powershell script that leverages the errort out function of Get-Chileitem specifically to record all instances of "too long file/foldernames" to a text file for identification and correction/mitigation.

I'll see if I can upload it for you tomorrow when I get to work. It can be run on the file server or from any client workstation (from the server would be faster, obviously)

You should be able to leverage the 8.3 filename data to modify the script to autorename the file/folder
 
I have a powershell script that leverages the errort out function of Get-Chileitem specifically to record all instances of "too long file/foldernames" to a text file for identification and correction/mitigation.

I'll see if I can upload it for you tomorrow when I get to work. It can be run on the file server or from any client workstation (from the server would be faster, obviously)

You should be able to leverage the 8.3 filename data to modify the script to autorename the file/folder

That would be interesting to have anyway.

Oh and ontop of all of this. There's 40TB+ data without deduplication activated.
 
NTFS actually has no problems with over 32000 chars in paths. It's the Window Explorer that fails beyond 260 characters (historical reasons). PS commands can handle long paths, so is Robocopy.
What I use as a replacement of Windows Explorer (as file manager) is XYplorer, it supports long filepaths, has tons and tons of features (small and big) that smashed my understanding about features in a file manager and made me no longer look at Explorer. Now over 10 years and counting.

I've been messing around with XYplorer, and it can't seem to copy those files with the long names using it. I'll have to stick with manually trying to fix all of the names by removing useless naming from directories.
 
I've been messing around with XYplorer, and it can't seem to copy those files with the long names using it. I'll have to stick with manually trying to fix all of the names by removing useless naming from directories.
I don't know when and/or how you tested. Now I tested again and it copies files from 300+ long paths just fine.
Well, if I try to rename a file to a name with over 255 chars, then XY fails with (its) error message about too long filename. I can't figure a use case when a single path element (folder or the filename) would need to exceed 255 chars.
 
I'm not saying I WANT to keep these the way they are as a permanent solution, I'm just saying for now I would rather. Just because I don't have time to deal with updating the names/paths. My plan is to initialize some new storage machines, build out some proper structure/policies for people to follow, and then from there, move current data / rename into the new storage/structure.

I'm trying Robocopy to just get it copied over but still run in to some permissions issues which are out of whack of course.
 
Back
Top