• 0

[MS-DOS batch] 7zip Duplicate file error in different directories


Question

Hi,

I need to use some ms-dos batch files to run 7zip for making compressed backup. However, it treats it as duplicate file name error when there are files with same name but in different directories :cry: .

Error:

Duplicate filename:

abc.txt

abc.txt

The list file looks like:

d:\test\backup\abc.txt

d:\test\backup\sub\abc.txt

The batch file looks like:

dir /B /S d:\test\*.* >> fileList.lst

"c:\programe files\7-zip\7z" a -tzip test.zip @fileList.lst

Any idea to solve the problem?

Thanks,

petal

4 answers to this question

Recommended Posts

  • 0

well.. what you are doing there is just listing out the file names and adding them to a zip file..

you need to zip the root directory instead of adding individual files

i don't have 7zip to hand but perhaps try something like..

"c:\programe files\7-zip\7z" a -tzip test.zip "d:\test"

not 100% sure though ;)

  • 0

I am also receiving a duplicate file error -

Originally, an archive was created with these syntax parameters to archive my documents and settings folder each day and update any files that have changed to a slaved D drive:

7z u -tzip D:\DocumentsAndSettings.zip "C:\Documents and Settings"

The archive was created. I then wanted to clean the archive file using an exclusion list of file types and directories. This is the syntax I used:

7z d D:\DocumentsAndSettings.zip -ir@C:\exclude\exclude.txt

This was the contents of my exclusion list:

"Documents and Settings\*\Local Settings\Temp\*"

"Documents and Settings\*\Local Settings\Temporary Internet Files\*"

*.bak

*.tmp

*.mp3

*.wav

*.mov

*.avi

*.mpg

*.url

After attempting to clean the archive file using my exclusion list, I get the duplicate file name error. The error reports back with 2 file names with the same names and identical creation dates placed in the same directories in the archive file. There is only 1 file on disk. How did 7zip place identical files in the same directory?

Any help would be greatly appreciated!

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • "This is despite the company inching closer to a $4 trillion market cap with each passing day." Sigh, you realise Microsoft doesn't own that $4T, right? That money is owned by investors. In fact, Microsoft is expected to hand out dividends which does come out of operating revenue, so that much market capitalisation can actually be a drain on a company, not a benefit. Microsoft's actual revenue in 2024 was around $375B with reported earnings of $155B which means that 59% of its earnings were eaten by expenses. You could legitimately argue that $155B is still a lot of money, so why lay off those workers? If we assume an average salary of $90K per worker, 9,000 workers mean $810M just in wages, which seems like small beans compared to $155B. But seriously, people have to get over market cap as a metric of anything other than investor confidence. It is NOT the measure of the actual worth of a company.
    • Looking forward to this.
    • You know - if you abbreviate 2038 as 2K38, it's exactly the same number of characters and so isn't actually an abbreviation - and worse, just makes it confusing for people who weren't aware of the original Y2K problem which happened 25 years ago.
    • This only works for sites that care about the law. Anyone who can't or doesn't want to meet the requirements will either use a VPN or go to a (piracy) alternative that doesn't care about the law. It'll be even worse than the people having visited the law abiding sites without the verification. So way to go on that one.
  • Recent Achievements

    • Dedicated
      EYEREX earned a badge
      Dedicated
    • First Post
      Electronic Person earned a badge
      First Post
    • Week One Done
      CyberCeps666 earned a badge
      Week One Done
    • Very Popular
      d4l3d earned a badge
      Very Popular
    • Dedicated
      Stephen Leibowitz earned a badge
      Dedicated
  • Popular Contributors

    1. 1
      +primortal
      606
    2. 2
      ATLien_0
      235
    3. 3
      Xenon
      159
    4. 4
      neufuse
      131
    5. 5
      +FloatingFatMan
      124
  • Tell a friend

    Love Neowin? Tell a friend!