How to archive (zip) certain file types (ex. PDF) in a folder structure

I wanted to zip only the PDF files (can be any type) from a large folder (~90 folders and sub folders) in a quick way.

Yes… I could zip it all, sort by type and delete, but that ain't smart and will take extra time.

Here's how I did it (and you can do it too).

I use 7-zip as it's free, open source and works great.
you can download 7zip from HERE
To do the task you will need to "go comando".
No need to take your clothes off, just type CMD in your windows > run window.

In the command windows (black ugly text thing adored by tech geeks) you will need to reach the 7-zip folder and run the archiving command.

1st – let's reach our 7z folder, we do this by entering (depending on your windows version etc…).

cd c:\program files\7-zip\

2nd – let's do some archiving. the syntax is as follows

7z.exe a [archive name] [location\]*.ext -r

for example

7z.exe a c:\vago.7z c:\*.pdf -r

The command above will add (a) files to an archive names vago.7z located at the root folder of c:\ that match the extension pdf.
If a file does not exists, it will be created.
If the file already exists, only new files will be added.

In this way, if i will run the last command followed by…

7z.exe a c:\vago.7z c:\*.Jpg -r

I will be adding all the jpg files located in my c: drive to the vago.7z file.

Feel free to comment, share, like…

Vago

About גיא ואגו

מנחה ומרצה, בעל שנות וותק רבות בתחומי השיווק, המכירות והיזמות העסקית. מילא תפקידי ניהול מגוונים במגזר העסקי, ביניהם, ניהול מכירות, ניהול שירות, פיתוח שותפויות מכירה וניהול כללי.