# Unzip doesn't extract to specified output folder

#### Phileosophos

Aug 28, 2008
127
4
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.

#### vefatica

May 20, 2008
11,629
110
Syracuse, NY, USA
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

#### Arminius

Dec 17, 2009
39
0
Germany
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".

#### Phileosophos

Aug 28, 2008
127
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!

#### David Marcus

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>

#### vefatica

May 20, 2008
11,629
110
Syracuse, NY, USA
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

Replies
10
Views
439
Replies
2
Views
538
Replies
3
Views
2K
Replies
0
Views
1K
Replies
3
Views
1K
Replies
2
Views
2K
Replies
5
Views
2K
D
Replies
3
Views
2K
Replies
12
Views
3K
Replies
1
Views
1K
Replies
0
Views
1K
Replies
3
Views
2K
Replies
3
Views
2K
Replies
0
Views
1K
Replies
1
Views
2K
Replies
4
Views
3K
Replies
4
Views
3K
Replies
6
Views
3K
Replies
3
Views
96
Replies
9
Views
205
Replies
16
Views
215
Replies
4
Views
456
Replies
2
Views
648
Replies
0
Views
582
Replies
10
Views
1K
Replies
11
Views
1K
Replies
4
Views
2K
Replies
1
Views
960
Replies
30
Views
5K
Replies
2
Views
1K
Replies
2
Views
1K
Replies
13
Views
3K
Replies
1
Views
960
Replies
1
Views
2K
Replies
2
Views
951
Replies
1
Views
1K
Replies
5
Views
964
Replies
14
Views
2K
Replies
0
Views
817
Replies
8
Views
1K
Replies
2
Views
2K
Replies
13
Views
3K
Replies
1
Views
965
Replies
1
Views
2K
Replies
1
Views
734
Replies
1
Views
903
Replies
6
Views
2K
Replies
1
Views
1K
Replies
3
Views
1K
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8977951407432556, "perplexity": 6298.082550519658}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320304760.30/warc/CC-MAIN-20220125035839-20220125065839-00199.warc.gz"}