I am attempting to write a batch script that uses the 7zip batch commands to extract a large list of zip files within a folder. However, this scenario has some specific conditions that I need to fulfill and I am looking for some help on how to do so. My problem has two components:
First Component:
The batch script I am trying to make will run on a target folder that consists of many compressed zip files and a Data folder. Each of the zip files within the target folder will have varying directories and sometimes some irrelevant folders that I do not want to extract, however, each of them will have a sub-folder named “Meshes” or “meshes” and another sub folder named “Textures” or “textures”. these folders – along with the directory structure and files within them is what I need to be extracting to the aforementioned Data folder.
Second Component:
This batch script, while only extracting the meshes and textures folders and preserving their subdirectories, will also need to control the order in which 7zip extracts the compressed zip files by the date the zip file was modified (or downloaded). The order needs to be from oldest to newest. You see, a considerable amount of the zip files within the target folder will actually have files in their meshes & texture folders I need to overwrite the previously modified(or downloaded) zip file.
Is there a way to do this in a batch script? Any and all help would be much appreciated.
So far I am familiar with the 7z x command that will preserve the subdirectories, but am unsure how to use that only on the specific subdirectories within the zip file that I need. And what’s more, I am also familiar with the -o command to specify my desired output directory I would like those folder extracted to. Having said that, I am also ignorant as to how to assign an order in which 7zip would extract the list of zip files AND am not sure how I could base that on the “Date Modified” information for each archive. Thanks in advance for your time.
Naughtilus is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.