Search code examples
cmd7zip

7zip CLI: specify target filename on extract


I'm trying in the last 4 hours to do something that sounds simple :) Can I (any how) set the target file in the 7za command? (I need to rename the target filename, and add .bak to its extension)

Here is the command right now:

7za e -bd -y -o"target_folder" "source_folder" "filename"

so, same filename will be on target here.

Thank you.


Solution

  • if you are certain there is only one file in the archive, you can do the following:

    7za e "c:\data\compressed_file.gz" -so > "c:\data\destination_file_name.txt.bak"
    

    I have not attempted working with an archive with multiple files.