Help - Unzipping Files in Batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
tequila_rifa
Posts: 1
Joined: 09 Sep 2009 03:52

Help - Unzipping Files in Batch

#1 Post by tequila_rifa » 09 Sep 2009 04:05

Hello All,

A newbie to this forum,
I have to write a batch script (to point out the location of source files) which will be run before a ETL workflow runs, .

The batch file must do the following,

imagine that, there is 1 zip file, which for eg contains 4 folders (each folder contains 5 text files with names like apple, orange, peach...)

TASK

1. first, unzip this file...
2. then i need the location where this file is extracted (for eg, C:\test\extract)
3. then within the batch file, write a command to create a text file, called, 'list1.txt'; what this file must contain is the extracted directory and the file name; for eg, like:
'C:\test\extract\folder1\apple.txt'
'C:\test\extract\folder2\apple.txt'.....'C:\test\extract\folder5\apple.txt'
another file like, 'list2' which contains: 'C:\test\extract\folder1\orange.txt'
'C:\test\extract\folder2\orange.txt'... 'C:\test\extract\folder5\orange.txt'

I am getting stuck on the extracting part.
I CANT USE SW's LIKE, PKUNZIP, INFOZIP...

PLEASE HELP..
THANKS IN ADVANCE,

avery_larry
Expert
Posts: 391
Joined: 19 Mar 2009 08:47
Location: Iowa

#2 Post by avery_larry » 09 Sep 2009 15:05

Fairly certain you MUST use 3rd party tools to unzip a file using the command line. The built-in zip manipulation that XP has does NOT expose any ability to use it on the command line (as far as I've been able to find).

Post Reply