zeotech
asked on
PowerShell to create list of files & folders over 255 characters
I need a Powershell script to search a folder (d:\public\records) and output of a list of all of the files that have a combined path (directory path + filename) of over 255 characters.
WHY?
I am using RichCopy to transfer 1TB of data from server to server. RichCopy crashes due to the file length limits. I must use RichCopy as it is the only tool that fulfills all of the requirements for this project. The directory I am checking contains a lot of data in tens of thousands of folders so workarounds like mapping a network drive to shorten the path will not work, there are just too many and I am not even sure where they are.
THANKS!
WHY?
I am using RichCopy to transfer 1TB of data from server to server. RichCopy crashes due to the file length limits. I must use RichCopy as it is the only tool that fulfills all of the requirements for this project. The directory I am checking contains a lot of data in tens of thousands of folders so workarounds like mapping a network drive to shorten the path will not work, there are just too many and I am not even sure where they are.
THANKS!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Just remember it doesn't check under dirs that are too long:
// Check if the directory length is valid, if the
// directory is too long then there is no point testing
// the sub folder/files until this is fixed.
Also in the code:
* I doubt What I have done is a good way of doing it, but
* works enough - if you have a better idea please go ahead.
I think my one liner was better as it checks all the files.
// Check if the directory length is valid, if the
// directory is too long then there is no point testing
// the sub folder/files until this is fixed.
Also in the code:
* I doubt What I have done is a good way of doing it, but
* works enough - if you have a better idea please go ahead.
I think my one liner was better as it checks all the files.
ASKER
Between this suggestion and the other code i can get the desired result.
ASKER
http://adamkett.blogspot.com/2008/09/find-fix-255-file-folder-maxpath.html