Hi akash0000
To compress try this syntax:
for %i in (*.jpg) do tar -a -c -f %~ni.zip %i
To unzip you have to create a list of desired files to process (list.txt), then:
for /f %i in (list.txt) do tar -xf %i.zip
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
hi there,
i am trying to zip 5 photos, using cmd command prompt.
the prompt i am using is: tar -a -c -f compressed.zip *jpg
and this works perfectly fine as all the files are getting zipped in a folder called compressed.zip
but the issue is all files are getting compressed in one folder(compressed.zip)
I want these photos to be zipped in each out their folders.
for example 5 different unique zip folders for each of the 5 photos.
viceversa
and to unzip i am using : tar -xf compressed zip.
which works fine too, but i would like unzip 5 zipped folders in 5 unquie folders
Any help here please
Akash
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Hi akash0000
To compress try this syntax:
for %i in (*.jpg) do tar -a -c -f %~ni.zip %i
To unzip you have to create a list of desired files to process (list.txt), then:
for /f %i in (list.txt) do tar -xf %i.zip
hi there,
this is really helpful
it works for me
now can i do it for folder.
For example, i have 5 folders
i want to zip these 5 folders with unique zip files
for example: 5 folders will have 5 .zip files
And vice versa;
if i have 5 zip files, i want to unzip them in 5 different folders of their own
The first command changes as below:
for %i in (*.jpg) do tar -a -c -f %~ni%~ni.zip %i
With the second commands you need to change the list.txt file
hi there,
thank you for your help there.
I am using this instead in cmd, which is more precise
| zip single jpg | for %i in (*.jpg) do tar -a -c -f "%~ni.zip" "%i" |
|---|---|
| unzip single jpg | for %i in (*.zip) do tar -xf "%i" |
| zip mutiple files | for /d %i in (*.*) do tar -a -c -f "%i.zip" "%i" |
| unzip multiple files | for /d %i in (*.zip) do tar -xf "%i" |
the prompt you gave me was giving me errors and was a bit confusing
akash
You're most welcome Akash.
Have a good day/night.