7-zip cannot find archive in current dir of other drive
A free file archiver for extremely high compression
Brought to you by:
ipavlov
7-zip incorrectly says that it cannot find a drive if the command line uses the "current directory" syntax (e.g., C:my_archive.zip).
Steps to reproduce:
1. Create a zip file on the desktop (C:\Users\Fish\Desktop\some_archive.zip).
2. Set current directory to the desktop.
3. Change to the D: drive.
4. Issue this command: 7z.exe" l C:some_archive.zip
7-zip displays:
Error:
cannot find archive
This is incorrect, which can be shown by this command:
dir C:*.zip
which lists the some_archive.zip, showing that it's in the current directory of the C: drive.
1. Create a zip file on the desktop
(C:\Users\Fish\Desktop\some_archive.zip).
2. Set current directory to the desktop.
3. Change to the D: drive.
4. Issue this command: 7z.exe" l C:some_archive.zip
What is step 2 - Set current directory to the desktop?
Sorry I wasn't more clear. Step two should be this command:
cd "C:\Users\%USERNAME%\Desktop"
That will change the current directory for the C: drive to the desktop of the current user.
These are the commands:
> cd "C:\Users\%USERNAME%\Desktop"
> 7z.exe" a -tzip test_file.zip test_file.txt
{ output from 7-zip }
> D:
> dir /b C:test_file.zip
test_file.zip
> 7z.exe l C:test_file.zip
7-Zip [NT] 4.42 Copyright (c) 1999-2006 Igor Pavlov 2006-05-14
Error:
cannot find archive
7-zip should find test_files.zip because the current directory of C: is the desktop where test_file.zip is located. I hope this is more clear. Let me know if a batch file with the commands would help.
I suppose it's old DOS-style feature.
Windows doesn't like it. And I don't like it.
It's not to be liked or disliked, just the way things are. Since it works in XP, Server, and Vista's command prompt, it's not only an "old" DOS-style feature--it's also a current DOS-style feature. Since 7z.exe is a command line tool, it'd be nice if it worked like the other commands available at the command prompt (e.g., dir, attrib, copy, xcopy, etc.).
I don't know how 7-zip is opening the archive, but a standard CreateFile() works with this syntax, so 7-zip is probably doing something to the path that prevents it from working.
It would be unfortunate if this isn't corrected. It's the only reason I still have to use unrar.exe and PKZip. (They work with this syntax.)
I hope you'll reconsider and fix it.