How to create individual ZIP files from folders

The following steps will show how to create individual ZIP files from a collection of folders.

The process will create a ZIP file for each folder – naming the ZIP file the name of the folder.

For example, if you have folders called:

  • example 1
  • example 2
  • example 3

it will create

  • example
  • example
  • example

Want an example? Download:


  1. The first thing you need to do, if you haven’t already, is move all the folders into a single location – making sure it only contains the folders you want to create zips from.
  3. Now you need to create a new text file called zipall.cmd and copy in the following information
  4. for /d %%X in (*) do "%ProgramFiles%\7-Zip\7z.exe" a "" "%%X\"
  5. Now run the zipall.cmd file and the zip files will be created.

TIP: How to create ZIP without root directory

This alternative command will create the ZIP files without the root directory in the ZIP file.

For example, the previous command would result in

  • example -> example 1 -> text file.txt

This command would result in

  • example -> text file.txt
for /d %%X in (*) do "%ProgramFiles%\7-Zip\7z.exe" a "" ".\%%X\*"

Help! How do I create a cmd file?

See How to create CMD files using Windows 10.




Related Articles

8 comments on “How to create individual ZIP files from folders

  1. hi
    thanks for your command
    however this command did not compress the files withing the zipped file so the size is exactly the same
    for /d %%X in (*) do “%ProgramFiles%\7-Zip\7z.exe” a “” “%%X\”

  2. Brilliant guide.. how do i zip the files into seperate zip folder which is there in the same location.. imagine there is a folder zip in the examples folder.. all the zip needs to go into the zip folder.. we need to ensure zip folder is also not picked up for zip

  3. Thank you, but how to zip only files in these folders? Because now I have: -> example1 folder -> files inside. And I need to have: -> files inside.

Leave a Reply to MaPu Cancel reply

Your email address will not be published. Required fields are marked *