Page 1 of 1

Help - Unzipping Files in Batch

Posted: 09 Sep 2009 04:05
by tequila_rifa
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,

Posted: 09 Sep 2009 15:05
by avery_larry
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).