Building Batch to List File Path Greater than X

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Cory Buford
Posts: 2
Joined: 21 Feb 2015 10:36

Building Batch to List File Path Greater than X

#1 Post by Cory Buford » 21 Feb 2015 11:37

Greetings,

I am working with large collections of files that, when decompressed, result in many errors due to a total file path longer than 260 characters. To resolve this, I am decompressing some of the sub-folders independently. However, I wish to also maintain a record of which file paths would have been too long; thereby resulting in the same error.

To automate this process, I am trying to build a small program to search the folder and sub-folders, filter for file patchs larger than "X" (user defined number to accommodate their unique situation) and then pipe the results to a text file.

Any help with this would be greatly appreciated,

Cory Buford

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Building Batch to List File Path Greater than X

#2 Post by foxidrive » 21 Feb 2015 18:50

Are you able to tell us if the files inside the archive have unique filenames, or are there many filenames that are the same.

There is an easy method to help you if the names are unique.

Cory Buford
Posts: 2
Joined: 21 Feb 2015 10:36

Re: Building Batch to List File Path Greater than X

#3 Post by Cory Buford » 21 Feb 2015 21:55

Thank you for your fast reply and, yes, in this case it's a large collection of 1 Million PLR articles. I know, I'm not a big fan of the Private Label Rights market myself but that's why I am trying to offer services that show Internet Marketers how to clean up the PLR industry by weeding out all of the duplicate collections.

The collection does contain many duplicate file names but they are in different sub-folders so the complete path names over 260 characters would be unique. My overall plan is to identify, and possibly copy into a separate folder, the files that raise the 260 error, remove all of the duplicate files and then archive a bug free version for those encountering similar problems.

Hoping your idea will work for my situation and, again, thank you for your time and help,

Cory Buford

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Building Batch to List File Path Greater than X

#4 Post by foxidrive » 22 Feb 2015 04:14

If they aren't unique names the the method I had in mind is of no use.

What you can do instead is to generate a list of the archive contents including path, and then use a batch file with that list
and have it extract each file in a separate invocation - and if the archiver returns a error in the errorlevel then the file/path
of each problem file can be logged for you to only deal with those that have problems.

This will take longer to process the archive - while giving you all the files with no issues - but it requires far less manual
intervention than would otherwise be the case.

If you need help with the details then we can assist you once we know more about the task,
such as a sample of the list of path\filename from the archive which you can get the archiver to generate.

Post Reply