Dynamically Unziping the files

Microsoft Windows xp professional editio...
October 29, 2009 at 00:06:33
Specs: Windows Server 2003
Hi All,

I have to Unzip a .Zip file (through a batch script from a share drive) which will have multiple folders inside, and inside these mutliple folders there will be some files and I have to copy these files from the multiple folders and Place them on my target folder which is in another share drive.

So If my .Zip file has some 10 folders and inside the 10 folders I will have some 80 files I have to extract all these 80 files to a folder A in my Target share drive..I don't want these 10 folders in my target Share drive.

Please help me how can I do this throug a Batch script.

Regards,
Mora


See More: Dynamically Unziping the files

Report •


#1
October 29, 2009 at 00:13:45
So you want all the files put into a single folder on the target?


=====================================
Helping others achieve escape felicity

M2


Report •

#2
October 29, 2009 at 00:27:58
Hi ,

Ya I want all the files to be in a single folder on the target.

Regards,
Mora


Report •

#3
October 29, 2009 at 01:14:00
@echo off & setLocal EnableDELAYedExpansion

md unzipped & pushd unzipped
pkunzip -d c:\temp\my.zip

for /f "tokens=* delims= " %%a in ('dir/s/b/a-d') do (
copy "%%a" d:\some\stuff
)


=====================================
Helping others achieve escape felicity

M2


Report •

Related Solutions

#4
October 29, 2009 at 04:28:29
Hi,

Thanks for the Script,but we don't have PKUNZIp installed on ur machine so I tried it with UNZIP but i am not able to unzip the directory structure of the Zip file .can you please tell me what is equivalnet command for pkunzip -d in unzip.

Regards,
Moras


Report •

#5
October 29, 2009 at 04:45:14
Give me a hint. What UNZIP do you have?

And did you try:

unzip

or unzip /?


=====================================
Helping others achieve escape felicity

M2


Report •

#6
October 29, 2009 at 04:52:06
Hi ,

I tried the below script.

@echo off & setLocal EnableDELAYedExpansion

md unzipped & pushd unzipped
UNZIP C:\ABC.zip

for /f "tokens=* delims= " %%a in ('dir/s/b/a-d') do (
copy "%%a" C:\kans

Regards,
Mora


Report •

#7
October 30, 2009 at 00:49:45
Hi ,

I have installed PKZIP,but the script is extracting the files to the unzipped folder and it is not moving from the unzipped folder to my Target directory.It just extracting the files and ending the script.

Please help me how can i move the bunch of files to my target location.

Regards,
Mora


Report •

#8
October 30, 2009 at 03:21:39
seems like mech's help got most of what you wanted.
see if your batchscript responds to anything after PKUNZIP,
such as "pause". if so, maybe try to CALL another script
to finish the job. seems like it should proceed,though, so there's prob'ly some small syntax error not being reported. it doesn't take much.

Report •

#9
October 31, 2009 at 02:50:43
@echo off & setLocal EnableDELAYedExpansion

md unzipped & pushd unzipped
pkunzip -d c:\temp\my.zip

for /f "tokens=* delims= " %%a in ('dir/s/b/a-d') do (
move "%%a" d:\some\stuff
)


=====================================
Helping others achieve escape felicity

M2


Report •


Ask Question