Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

So you want all the files put into a single folder on the target?
=====================================
Helping others achieve escape felicityM2

@echo off & setLocal EnableDELAYedExpansion
md unzipped & pushd unzipped
pkunzip -d c:\temp\my.zipfor /f "tokens=* delims= " %%a in ('dir/s/b/a-d') do (
copy "%%a" d:\some\stuff
)
=====================================
Helping others achieve escape felicityM2

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

Give me a hint. What UNZIP do you have?
And did you try:
unzip
or unzip /?
=====================================
Helping others achieve escape felicityM2

Hi ,
I tried the below script.
@echo off & setLocal EnableDELAYedExpansion
md unzipped & pushd unzipped
UNZIP C:\ABC.zipfor /f "tokens=* delims= " %%a in ('dir/s/b/a-d') do (
copy "%%a" C:\kansRegards,
Mora

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

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.

@echo off & setLocal EnableDELAYedExpansion
md unzipped & pushd unzipped
pkunzip -d c:\temp\my.zipfor /f "tokens=* delims= " %%a in ('dir/s/b/a-d') do (
move "%%a" d:\some\stuff
)
=====================================
Helping others achieve escape felicityM2

![]() |
Create text file based on...
|
dos - day of week
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |