Computing.Net > Forums > Programming > Dynamically Unziping the files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Dynamically Unziping the files

Reply to Message Icon

Name: moras
Date: October 29, 2009 at 00:06:33 Pacific
OS: Windows Server 2003
Product: Microsoft Windows xp professional edition
Subcategory: Batch
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: October 29, 2009 at 00:13:45 Pacific
Reply:

So you want all the files put into a single folder on the target?


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

M2


0

Response Number 2
Name: moras
Date: October 29, 2009 at 00:27:58 Pacific
Reply:

Hi ,

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

Regards,
Mora


0

Response Number 3
Name: Mechanix2Go
Date: October 29, 2009 at 01:14:00 Pacific
Reply:

@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


0

Response Number 4
Name: moras
Date: October 29, 2009 at 04:28:29 Pacific
Reply:

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


0

Response Number 5
Name: Mechanix2Go
Date: October 29, 2009 at 04:45:14 Pacific
Reply:

Give me a hint. What UNZIP do you have?

And did you try:

unzip

or unzip /?


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

M2


0

Related Posts

See More



Response Number 6
Name: moras
Date: October 29, 2009 at 04:52:06 Pacific
Reply:

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


0

Response Number 7
Name: moras
Date: October 30, 2009 at 00:49:45 Pacific
Reply:

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


0

Response Number 8
Name: nbrane
Date: October 30, 2009 at 03:21:39 Pacific
Reply:

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.


0

Response Number 9
Name: Mechanix2Go
Date: October 31, 2009 at 02:50:43 Pacific
Reply:

@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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Create text file based on... dos - day of week


Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Dynamically Unziping the files

Unziping file and generating log based on www.computing.net/answers/programming/unziping-file-and-generating-log-based-on/20233.html

How to get the file size? www.computing.net/answers/programming/how-to-get-the-file-size/12976.html

Pls Help - Batch File www.computing.net/answers/programming/pls-help-batch-file/12167.html