title: zipping files with the same name in different folders using 7z @listfile feature
body: <p>I want to create a 7zip file containing files with the same names but in different folders using 7zip's @listfile feature. Although I have used 7zip CLI for a long time, I just cannot find the syntax to accomplish this. </p>
  
  <p>My file tree looks like this (note that somefile1.html and somefile2.html occur twice each).</p>
  
  <pre><code>|   somefile2.html
  +---dir1
  |       somefile1.html
  |       somefile2.html
  |       
  +---dir2
  |       somefile3.html
  |       somefile4.html
  |       
  \---dir3
          somefile1.html
          somefile5.html
  </code></pre>
  
  <p>Using a @listfile works fine, but I cannot figure out how to retain the directory tree in the resulting 7zip while doing that.</p>
  
  <p>I have tried to the following syntax:</p>
  
  <p>7z a -ir@files.txt my_compressed_file.7z</p>
  
  <p>Then, given the explanations in 7zip's Windows CHM help file under syntax, I tried including the root folder, too (called 'files'):</p>
  
  <p>7z a -ir@files.txt my_compressed_file.7z .\files</p>
  
  <p>I get the same error in both cases:</p>
  
  <pre><code>Error
  Duplicate filename:
  somefile1.html
  somefile2.html
  </code></pre>
  
  <p>Has anyone figured this one out and would care to shed some light on it? </p>
  
  <p>I know how to compress files with the same names in different folders otherwise (when the folder structure is retained in the 7zip it s no problem). But this time the few files I need are spread all over the place...</p>