Archiving unwanted directories

Help
The Baron
2004-12-01
2012-12-07
  • The Baron
    The Baron
    2004-12-01

    I've just started using 7-Zip, so I'm probably doing something wrong, but I can't get it to zip up just one directory. I want to zip up c:\Users\bob, but it grabs c:\Users\photo\bob too. Here's the output from the command prompt:

    --- start output ---
    D:\blah>"d:\Program Files\7-Zip\7z.exe" a -tzip -r test.zip c:\Users\bob

    7-Zip 4.12 beta  Copyright (c) 1999-2004 Igor Pavlov  2004-11-18

    Scanning

    Updating archive test.zip

    Compressing  bob
    Compressing  bob\daveandthesis
    Compressing  photo\bob
    Compressing  photo\bob\clivia.jpg
    Compressing  photo\bob\daveandjas.jpg
    Compressing  photo\bob\daveatherdsman.jpg
    Compressing  photo\bob\davejasminesouthperth.jpg

    Everything is Ok
    --- end output ---

    Any suggestions would be greatly appreciated.

     
    • Igor Pavlov
      Igor Pavlov
      2004-12-01

      don't use -r switch.

       
    • When would you use the -r switch then?

       
    • The Baron
      The Baron
      2004-12-02

      Thanks Igor, removing the -r made it work as I wanted. However, (as with the comment from 'nobody') it makes me more confused than ever as to the function of -r and -r-.

      When I use -r- to disable recursing of subdirectories, they are still added, eg.

      --- start output ---
      D:\blah>"d:\Program Files\7-Zip\7z.exe" a -r- -tzip test.zip c:\users\bob

      7-Zip 4.12 beta  Copyright (c) 1999-2004 Igor Pavlov  2004-11-18
      Scanning

      Creating archive test.zip

      Compressing  bob
      Compressing  bob\test.txt
      Compressing  bob\womble
      Compressing  bob\womble\another.txt

      Everything is Ok
      --- end output ---

       
      • Igor Pavlov
        Igor Pavlov
        2004-12-02

        -r is for files.

        Example:

        1.txt
        dir1\2.txt

        1) *.txt will compress 1.txt
        2) *.txt -r will compress 1.txt and dir1\2.txt