Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8193195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:24:22+00:00 2026-06-07T04:24:22+00:00

My software is supposed to collect files into a .zip or .7z archive using

  • 0

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:

D:\Software\Components\Station1\Alarms\Logs\ValvePressureSensor.xml
D:\Software\Components\Station1\Configurations\ValvePressureSensor.xml
D:\Software\Components\Station2\Alarms\Logs\ValvePressureSensor.xml

These files are stored in a list “FileList.lst” and I am calling 7-zip this way:

7za a -t7z "D:\Software\CollectedData\Diagnostics.7z" 
"@D:\Software\ZipTemp\FileList.lst"

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?

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.

I should mention that I am using Visual Studio 2005, C#2.0, and 7-zip v9.20.

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?

EDIT 2: turns out you cannot keep file folder info with 7-zip

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T04:24:25+00:00Added an answer on June 7, 2026 at 4:24 am

    I am aware of the workaround involving the removal of “D:\” from the beginning of each file path, but this would be impossible manually

    So remove it dynamically. If your paths are consistent, a simple path.Substring(3) will suffice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A software is producing UTF-8 files, but writing content to the file that isn't
I don't have a lot of experience developing web-based data entry software, but comparative
I'm working on a script that is supposed to install some software from a
For my software development programming class we were supposed to make a Feed Manager
I am supposed to fulfill a common-for-most-developers request to build/consume secure services using ssl/tls...
I want to repeat a random number sequence generated by a legacy software using
I am using Git alone for my local software project in Visual Studio 2010.
I am using Versions (Mac OS X SVN software) and have created a branch
I am supposed to be updating a piece of software for someone. Originally written
There are a lot of sites out there that teach people how to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.