Menu

Add files to a specific folder inside archive

alauck12
2015-04-24
2015-04-25
  • alauck12

    alauck12 - 2015-04-24

    I have a zip file, archive1.zip, I created with 7-zip. Archive1.zip contains two folders, folder1 and folder2. I want to add a file to folder2 inside archive1.zip. I have read the docs and cannot find a way to do this.

    Does anyone know how I can do this from the command line as well as the add to archive dialog box?

     
  • Shell

    Shell - 2015-04-24

    1) drag-and-drop;
    2) add the files and then use the rn command to move them to folder2.

     
    • alauck12

      alauck12 - 2015-04-24

      Thanks for the reply, the drag & drop isn't an option because all files are encrypted and this option is not available once the file is added to the archive (at least I haven't found a way to do it using the .zip format).

      I have looked through the help file and did not find the rn command and I'm not sure how this would be used. I use a batch file to add files to the archive and do use the -r switch to scan sub-directories for files to be added but I haven't seen the rn command to move the files to a sub-directory within the archive.

       
  • Shell

    Shell - 2015-04-24

    Sorry, I have not mentioned that the rn command has been implemented since version 9.30. If installing a beta version is suitable for you, I suggest you to upgrade to 7-Zip 9.38. Otherwise, you may use 7-Zip standalone (7za.exe) to move files within archives - it does not require installing.

     

    Last edit: Shell 2015-04-24
    • alauck12

      alauck12 - 2015-04-25

      Thanks for the info...I installed the 7-zip beta version 9.38 and the rn command worked fine. It's too bad this can't be done in the 7-Zip manager for us Windows-centric users so we can use drag 'n drop for encrypted files -).

      Thanks again for helping with this problem...I appreciate it.

       
      • Shell

        Shell - 2015-04-25

        I am not sure about the GUI method; it may well exist - let someone else answer this question. However, there used to be some bugs in adding files to a password-protected archive. You may want to check the resulting archive - whether the correct passwords have been applied.

        As a workaround, you may create folder2 in the filesystem, put the desired files there and add the whole folder to the archive.

         

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.