Link to home
Start Free TrialLog in
Avatar of David Bird
David BirdFlag for United States of America

asked on

File path too long reading recursive files and folders

I have inherited a windows 2003 SBS server network where over the years literally millions of files have accumulated. Moving/archiving them to the new server fails because many files are over 300 characters in the path and file name.  I am unable to run my code against the folder tree as it fails when it hits one of these files.  I don't want to trap the error and skip it. It's those files specifically I'm looking for.  While secondary but not entirely rhetorical, to me it begs the question, how were the files ever written in the first place?
I would appreciate any help on how to, via if possible, read the folder tree and store it in a data table so that we can access and rename these files to a reasonable length and move them off of the server.

Avatar of pjam
Flag of United States of America image

Probably by desktop shortcuts to the middle of the path.  255 is the limit but users find a way around that and is a constant pain to Network Admins.
Avatar of David Bird
David Bird
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David Bird


No one responded and as I continued my quest, I found Delimon's IO replacement