Menu

#1540 Option to compress multiple files into individual archives of same name

open
None
7
2022-04-10
2021-11-06
No

I hope the title is clear; Instead of compressing multiple selected files into a single compressed archive, I'd like the option to be able to create individual archives for each selected file.

For example:
File1.docx => File1.7z
File2.pdf => File2.7z
File3.xlsx => File3.7z

My use case is this: at work, I need to do exactly this on legal documents, while adding a password to every file (same password on all is fine). It would remove the tediousness of creating an archive for each file one-by-one, and avoid having to create a script to accomplish this (too complicated for the average user).

I'm sure the need for this is low, so I put a low priority number on this, but I hope someone agrees to accept this idea and make it happen. Thank you very much!

Discussion

  • Steve Willoughby

    P.S., I'm willing to pay/donate to help make this feature happen.

     

    Last edit: Steve Willoughby 2021-11-06
    • Sam Tansy

      Sam Tansy - 2021-12-10

      You can make a script to do that. It can pak all found files, or files specified in command line or in file.

       

      Last edit: Sam Tansy 2021-12-10
      • Steve Willoughby

        Thanks for your response. As mentioned, I don't want to have to create a script to do that.

         
  • greatapo

    greatapo - 2022-03-29

    I don't think this is a low demand feature and I would like to see a native implementation.

    I have created a bat file were I drag and drop files or folders. This will delete the files after compression, you can remove that from the code. The only problem is windows' limitation in character when passing arguments.

    You can probably add the password as an argument, I haven't try it.

    @echo off
    Title Multi Compressor
    echo Drag and drop folders or files to compress them to 7zip each and then delete them
    echo Author: GreatApo
    echo Version: 1.1
    echo Credits: https://superuser.com/questions/94421/how-to-make-7-zip-do-a-whole-bunch-of-folders
    echo.
    
    if [%1]==[] (
        echo Drag and drop folders/files to compress.
        @pause
        goto :eof
    )
    
    rem Check if 7zip is installed
    if not exist "%ProgramFiles%\7-Zip\*" (
        echo 7zip is not installed. Compression aborted.
        @pause
        goto :eof
    )
    
    :loop
    rem Compress the folder/file
    "%ProgramFiles%\7-Zip\7z.exe" a -t7z "%~1.7z" "%~1"
    
    rem Check if 7zip file was created
    if exist "%~1.7z" (
        rem 7zip file exists
        if exist "%~1\*" (
            echo 7zip file created. Deleting folder...
            @RD /S /Q %1
        ) else (
            echo 7zip file created. Deleting file...
            del "%~1" /F /Q
        )
    ) else (
        rem 7zip file doesn't exist
        echo 7zip file not found. Folder/File will not be deleted.
    )
    shift
    
    rem Check if more folders/files remaining
    if not [%1]==[] goto loop
    
    @pause
    
     

    Last edit: greatapo 2022-03-29
    • Steve Willoughby

      I'm glad I'm not the only one. Thanks for sharing your solution!

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.