title: 7-zip (7za.EXE) in C# to archive files of same name & store folder information
body: <p>My software is supposed to collect files into a .zip or .7z archive using 7zip, but due to the nature of the software, there are a lot of files with the same name, but different directories like:</p>
  
  <pre><code>D:\Software\Components\Station1\Alarms\Logs\ValvePressureSensor.xml
  D:\Software\Components\Station1\Configurations\ValvePressureSensor.xml
  D:\Software\Components\Station2\Alarms\Logs\ValvePressureSensor.xml
  </code></pre>
  
  <p>These files are stored in a list "FileList.lst" and I am calling 7-zip this way:</p>
  
  <pre><code>7za a -t7z "D:\Software\CollectedData\Diagnostics.7z" 
  "@D:\Software\ZipTemp\FileList.lst"
  </code></pre>
  
  <p>So I'm wondering whether there is a way to keep the directories of each file when they are zipped to stop 7-zip from flagging duplicate files?</p>
  
  <p>I am aware of the workaround involving the removal of "D:\" from the beginning of each file path, but this would be impossible manually as the "FileList.lst" is populated in the C# code with around 1500~3000 files (which aren't always the same files), and the FileList.lst is located in a temporary folder which is created, zipped, then destroyed dynamically. So I couldn't store the 7za.EXE in the same area. On top of that, the file list is used by another executable which does need the drives specified in the file paths.</p>
  
  <p>I should mention that I am using Visual Studio 2005, C#2.0, and 7-zip v9.20.</p>
  
  <p>EDIT: my question was fairly broad before, I should clarify that I'm switching from WinZip(due to licensing issues) so I recall that in WinZip  If you add -p switch, WinZip will store folder information for all files added, not just for files from subfolders; the folder information will begin with the folder specified on the command line.   Do you know of something similar in 7zip?</p>
  
  <p>EDIT 2: turns out you cannot keep file folder info with 7-zip</p>