Duplicate filenames on extraction - windows command-line version
A free file archiver for extremely high compression
Brought to you by:
ipavlov
When a file with a long filename is extracted, it may create an alias 8.3 filename which matches a filename to be extracted later from the archive.
If the 8.3 filenames were extracted first and the long filenames extracted as a second phase, this problem could be averted.
8.3 filenames are created by OS, not by 7-Zip itself. Such names often look like FILENA~1.TXT, which almost always guarantees they will not match meaningful filenames. Do you have an example of the contrary?
It is possible to make 7-Zip delete the short name, but I think this matter should be handled by the OS.
facing exact same issue :(
fixed it :)
link
Last edit: Anonymous 2015-05-25
https://support.microsoft.com/en-us/kb/121007
To disable 8.3 name creation on all NTFS partitions, type fsutil.exe behavior set disable8dot3 1 at an elevated command prompt, and then press Enter.
you can also disable it on a specific partition.
Here's a batchfile I used for testing:
*** Notes: My U: drive is a 2Gb FAT Ramdrive.
*** This particular batch has never failed, but have found similar batches attempting to extract from an archive where a shortfilename is generated which matches the full filename of a filename to be extracted later in the archive.
Now here's an astounding preculiarity:
If I execute a series of commands from the prompt:
Then it sometimes works - and sometimes fails, with no apparent pattern. I've tried different times-of-day, starting a fresh cmd.exe instance, having multiple cmd.exe instances and have been unable to discern a pattern.
Sadly, mr. kim's link above fails for me. I'm aware that "echo u|7z e archive.7z" will overcome the problem - but by auto-renaming the sfns. (I'd suggest a switch (-au?)) to control automatic-accept-renaming)
Perhaps
(Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit?
could be extended to
(Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit
(K)ey in new name / (R)eplace with autogeneratednewname ?
Where K would allow a new name to be keyed in from the keyboard and R would extract the file to a new name "autogeneratednewname" for this file only, unlike U which accepts the auto-geenrated new name for all clashing filenames.
Nobody argues that there is such a problem. The fact is that filenames like
demons~1.txtdo not usually appear in archives. In my opinion, this behavior with short names needs not to be fixed, at least in 7-Zip.As for manual renaming, I think it might be a useful feature.