Zip all files in a directory and give it directory name?

Programming related discussions related to game research
Teancum
Posts: 94
Joined: Mon Sep 22, 2014 5:13 pm

Zip all files in a directory and give it directory name?

Post by Teancum »

Is there an easy way to zip all files in a subfolder, save to the root folder, then give the zip file the name of the subfolder? Forza Horizon zips up each car by the name of the folder. For example, the \ACU_IntegraR_01\ directory contains all the files for the 2001 Acura Integra R, but the game will also take the contents of that folder in a zip file called ACU_IntegraR_01.zip. Is there a way to automate zipping these? I have about 500 folders, one for each car, and didn't know if there was an easy way to:

1-Enter the subfolder
2-Zip the contents
3-Name the file to [subfolder name].zip and save to root folder
4-Iterate repeatedly until all folders are zipped
Pickle
Posts: 9
Joined: Thu Jul 14, 2022 6:24 pm

Re: Zip all files in a directory and give it directory name?

Post by Pickle »

The easy way would be to use a batch file and something like 7-zip. I'm not good at batch files so that's about all the help I can give you.