batchfile unzip & recreate folder

? ?
February 12, 2009 at 14:40:59
Specs: Windows XP, ?
Hi,
I'm trying to write a batch file to unzip a file and then recreate the folder structure of that zip file. This is what I have so far:
wzunzip -d *.zip c:\test\defectdata\%1

That code works if I have 1 zip file. If I have multiple zip files, it extracts all to the same recreated folder. Is there a way to the file unzip to its own folder.
For example,
hello.zip
hi.zip
Once unzipped, it would have 2 different foldrs: hello and hi.
Thanks.


See More: batchfile unzip & recreate folder

Report •


#1
February 12, 2009 at 19:34:24
This should get you close. BUT, pkunzip wants to truncate LFNs to 8.3 names.

=============================================
@echo off & setLocal EnableDelayedExpansion

pushd c:\temp

for /f "tokens=* delims= " %%a in ('dir/b *.zip') do (
pkunzip -d %%a %%~Na\
)


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
February 13, 2009 at 13:44:31
mm nvm. i got it. the command is more simple than i thought.
thx for replying tho

Report •

Related Solutions


Ask Question