• 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

    • Both a game adaptation and it's on Amazon I'll set my hopes low
    • You shut your mouth you young fart, that was just a few years ago, lol.
    • Good effort, but unfortunately not very useful in the real world, since it doesn't support UEFI - which is a major drawback. More than that, most PCs these days have Secure Boot enabled by default, so unless you're tech savvy, the average joe is not going to disable Secure Boot - which means automated Windows > Linux migration programs like this will not work. And if you're tech savvy enough to know how to disable Secure Boot, then you're tech savvy enough to just flash a USB drive and install Linux the usual way - after all, the actual installation process is just point-and-click. So I don't see a use case here to be honest, especially considering the lack of UEFI support - especially when you consider that more and more Linux distros are completely dropping BIOS support (eg Fedora dropped it back in 2022). So this program is a bit too late to the party.
    • I agree with open rights group that the age check companies should be regulated but action does need to be taken imo, they may be called irresponsible parents but the fact is that many don't know how to set up blocks. Why should kids suffer because their parents don't know something? I think the UK has always been a bit like this. We don't say healthcare is your responsibility, we tax everyone and make people register with the NHS. We also don't expect everyone to brush their teeth to maintain dental health, we just put fluoride in their water assuming people aren't brushing enough, because some probably aren't or aren't doing it properly. In general, this way of doing things works.
  • Recent Achievements

    • One Month Later
      Falcon.ai earned a badge
      One Month Later
    • Week One Done
      Falcon.ai earned a badge
      Week One Done
    • 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
  • Popular Contributors

    1. 1
      +primortal
      629
    2. 2
      ATLien_0
      237
    3. 3
      Xenon
      165
    4. 4
      neufuse
      142
    5. 5
      +FloatingFatMan
      123
  • Tell a friend

    Love Neowin? Tell a friend!