Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

extract sub folder contents without parent folder using 7zip in batch files

I have one zip file in source path called crewing.zip, zip file structure is as follows:

crewing\Build\Areas

i just want to extract only the folders and files under Build, i dont want the parent folder Build to be in destination location

Source Folder path: \10.201.1.6\TempPath\CL1

Destination Folder path: D:\Client1\inetpub\wwwroot

Expected Result: D:\Client1\inetpub\wwwroot\crewing\Areas

in unzip format, below is the code which i tried in batch files

7za X \10.201.1.6\TempPath\CL1\crewing.zip -y -oD:\Client1\inetpub\wwwroot crewing\Build* -r

please help me now in destination parent folder build also obtained.

like image 871
Techie Buddhas Avatar asked Aug 30 '25 17:08

Techie Buddhas


1 Answers

Try:

7z x -y -oD:\GWClient\inetpub\wwwroot \10.201.1.6\MariApps\GW\crewing.zip crewing\Build\*

You'll have to remove the Build dir afterwards.

like image 145
Henrik Avatar answered Sep 02 '25 13:09

Henrik