How to compress multiple folders with 7zip

Author: William Ramirez
Date Of Creation: 17 September 2021
Update Date: 1 July 2024
Anonim
How To - Ep #9  - Compress Multiple Folders Into Multiple Zip Files Automatically Using 7ZIP
Video: How To - Ep #9 - Compress Multiple Folders Into Multiple Zip Files Automatically Using 7ZIP

Content

This article will describe how to use the free 7zip program to compress multiple folders. Compression is useful when you are backing up files or when you need to compress many file folders. This method involves using the 7zip program in a Windows batch file.

In this example, let's say we have several folders with music that need to be compressed so that we can later make a copy on an external hard drive. These folders are contained within one large folder called My Music.

Steps

  1. 1 Install 7zip. If you install this program with the default parameters, it will be located in the following path: "C: Program Files 7-zip 7z.exe".
  2. 2 Open notepad. Don't run 7zip after installing it, you won't need a graphical interface.
  3. 3 In notepad, enter this line of code: for / d %% X in ( *) do "c: Program Files 7-Zip 7z.exe" a "%% X.7z" "%% X "
  4. 4 Note: if you want to change the file extension to .ZIP, change the extension "%% X.7z" to "%% X.zip"
  5. 5 Click "File" -> "Save As".
  6. 6 Open the location of the folder you want to compress. In our case, this is C: My Music.
  7. 7 Create your batch file, when saving, set the file type to "All files" and name it something like "Folder for multiple 7z.bat archives". Pay attention to the file extension, which in our case is .bat. Make sure you didn't set the file type to "text document" when saving.
  8. 8 Click "Save".
  9. 9 Close Notepad and go to the My Music folder. Note that the batch file is located in the same path as the folder to be compressed.
  10. 10 Run the batch file by double clicking on the bat file located in the My Music folder. DO NOT RUN it as an Administrator (this feature appears in the menu when you right-click on the file). Running as Administrator will compress files in windows / system32. After running the bat file, the command line will appear and 7zip will start the compression process.

    • The command prompt will disappear after all compressed folders have been created. They should all be in your folder.
  11. 11 Check the health of your compressed folders. To do this, select them all and right-click. If you installed 7zip with default settings, you should have a menu included in the Windows shell. Navigate to it and click "Test Archive".
    • The program should report that there are no errors in your archive.
    • You have completed the creation of multiple compressed folders in a single 7zip run. You can now move them to your external hard drive. You can delete the batch file or move it to a different folder.

Tips

  • Save the batch file for future use. The next time you need to compress the compound folders, just copy the batch file to where the aforementioned folders are located and run it.
  • Changing the encoding in Notepad so that the original file extension is .cbz (rather than .zip) will enable this batch file to be used in comic readers.
  • With a batch file, you can compress any folder, not just the music folder.
  • If the 7zip program is installed in a different path, find its location and specify this path in notepad.
  • DO NOT RUN the file as Administrator. This will compress files in windows / system32. just open it with a double click.

What do you need

  • A computer based on the Windows operating system.
  • 7zip archiver that you can download from here.
  • A text editor for creating a batch file, such as notepad.