Windows – Automatically extract and rename extracted file according to archive’s name

7-zipcommand linewindows 7

I have a bunch of zip files in a folder. Each zip file has a file in it named exp_1.txt. I would like to unzip each zip file and rename the extracted file from each zip file to what the zip file was named.

The zip files names don't follow any pattern or date structure, but are all different. I have figured out how to get the exp_1.txt file extracted into the same directory as the zip file, but can't figure out the renaming of exp_1.txt to match what the zip file it was extracted from is named.

Once again in fewer words: from TuesdayReport.zip I want to extract the only file exp_1.txt and rename it to TuesdayReport.txt in the same directory as TuesdayReport.zip.

Currently I'm using 7z x to extract the file to the same directory the zip file is located in. I would prefer to be able to run this from a batch file.

Best Answer

why not using 7zip command line edition, that you can download from here?

inside this zip file you can find a help file in CHm format that has all switches and commands that can help you during your batch process.

Related Question