Unzip doesn't extract to specified output folder

Aug 28, 2008
100
3
#1
I fear I must be doing wrong, but I can't seem to figure out what it is. I'm trying to do what seems to me like something pretty basic with the unzip command. I have a zip file, and I want to extract its contents (preserving directory structure) into a target folder. For sake of example, let's say the name of the file is "File.zip" and the name of the output folder is "Output". Here's the command I use:

unzip /D File.zip Output

What I always get is an error telling me it can't find "Output". If I create that folder I still get the same error. The help file shows the format of the command as "UNZIP [/C /D /E /F /Nt /O /Q /S"password" /U /V] ziparchive path file", so I expect that I'm telling it to unzip "File.zip" into a folder named "Output", but that's clearly not what's happening. Can someone enlighten me? Thanks.
 
#2
On Sat, 29 May 2010 14:58:54 -0400, Phileosophos <> wrote:

|unzip /D File.zip Output
|
|What I always get is an error telling me it can't find "Output". If I create that folder I still get the same error. The help file shows the format of the command as "UNZIP [/C /D /E /F /Nt /O /Q /S"password" /U /V] ziparchive path file", so I expect that I'm telling it to unzip "File.zip" into a folder named "Output", but that's clearly not what's happening. Can someone enlighten me? Thanks.

In the absence of a list of files to extract, it appears to be taking "Output"
as specifying what you want extracted. This works better

unzip /d File.zip Output *

The help says:

... ziparchive path file ...
If path is not specified, files are extracted to the current directory.

I guess it's acting as expected, but a better syntax line would be

... ziparchive [path] file ...

Some explanation if "file ..." is in order too ... especially that it may
contain wildcards.
--
- Vince
 
Dec 17, 2009
31
0
Germany
#3
I fear I must be doing wrong, but I can't seem to figure out what it is.
The answer seems to be both yes & no:

you are doing something wrong, but it seems not to have anything to do with the problem you report - that exists independently.

1. According to the TCMD help, the unzip switch /D is meant to "Recreate the directory structure saved in the zip file."

2. To extract the contents of a zip file into a certain directory (if I understand the help file correctly), you just specify that path on the command line, without the need for a particular option:

UNZIP [/C /D /E /F /Nt /O /Q /S"password" /U /V] ziparchive path file ...

/D Recreate the directory structure saved in the zip file.

ziparchive The Zip file to work with

path The path where files will be extracted

file The file(s) to extract

path specifies the path where files will be extracted. If path is not specified, files are extracted to the current directory.
But if I try that in a TCC window, e.g. with unzip IP-Inf.zip InHere\ I get the same error messages as you:
the target directory is reported as a "file not found".
 
Aug 28, 2008
100
3
#4
you are doing something wrong, but it seems not to have anything to do with the problem you report - that exists independently.
Thanks, but I don't see what I'm doing wrong. I'm not using the "/D" switch because I want the output in a particular folder; I'm using it because the zip files I'm processing have directory information saved with them. Thus, I'm using the "/D" switch to extract them with that directory information intact.

Thankfully, what vefatica says is helpful: as long as I change the command to include a "*" at the end, then it will unzip correctly into the directory I specify. And interestingly enough, for sake of completeness, if the directory I specify doesn't exist, then it will unzip into the current folder without any error.

Suffice it to say, the unzip command seems buggy to me. Either that, or the help text really needs some improvement. Thanks!
 
#5
I have the same problem. Adding * to the command doesn't help:

C:\Junk>ver /r

TCC 11.00.48 x64 Windows 7 [Version 6.1.7600]
TCC Build 48 Windows 7 Build 7600
Registered to davidmarcus - 1 System License

C:\Junk>dir

Volume in drive C is TI105444W0C Serial number is 709c:de9d
Directory of C:\Junk\*

5/30/2010 10:41a DIR .
5/30/2010 10:41a DIR ..
5/30/2010 10:41a DIR Foo
5/30/2010 10:36a 671,536 ZippedListDownload1.zip
671,536 bytes in 1 file and 3 dirs 671,744 bytes allocated
265,546,969,088 bytes free

C:\Junk>unzip ZippedListDownload1.zip Foo\ *
TCC: (Sys) The system cannot find the file specified.
"Foo\"
=> C:\Junk\Foo\RatingList.csv
=> C:\Junk\Foo\ClubList.csv

C:\Junk>
 
#6
On Sun, 30 May 2010 10:48:02 -0400, David Marcus <> wrote:

|C:\Junk>unzip ZippedListDownload1.zip Foo\ *
|TCC: (Sys) The system cannot find the file specified.
| "Foo\"
|=> C:\Junk\Foo\RatingList.csv
|=> C:\Junk\Foo\ClubList.csv

In spite of the error message, it appears to have worked. When I try the same
thing, it gives the error message *and* works.

This is odd: When I throw in "/d", I see

v:\> unzip /d a.zip dira *
Indexing V:\
TCC: (Sys) The system cannot find the file specified.
"dira"
V:\dira\t1.btm (Replace) (Y/N/A/R)Y
=> V:\dira\t1.btm
Indexing V:\

What the heck is "Indexing V:\"? I have

v:\> option FuzzyCD
FuzzyCD=0
--
- Vince