Setting WinRAR to exclude specified files from being extracted

galacticninja

New member
Local time
9:46 AM
Messages
19
I would like to ask how to set WinRAR to exclude files with the exact filenames: 'thumbs.db' or '.DS_Store' (without the quotes, ignore case) from being extracted from an archive.

Ex. Files with these filenames should not be extracted:

Thumbs.db
thumbs.db
THUMBS.DB
.DS_Store
.ds_store
.DS_STORE

while files with these filenames should be extracted:

1Thumbs.db
1thumbs.db
tackthumbs.db
Thumbs.db.txt
Abcd thumbs.db.txt
1.DS_Store
Abcd.ds_store
.DS_Store.txt
Abcd.DS_STORE.txt

In 'Settings->Security->Prohibited file types->File types to exclude from extracting', if I just type in 'thumbs.db .DS_Store' (without the quotes) in the field, will it work the way I described?

Also, does anyone know if WinRAR has a syntax guide for the Prohibited file types list in case I'd like to add more filenames or be flexible with the rules I need?

The reason for this question, is I'd like to not extract unnecessary files from ZIP, RAR or 7z archives in Windows 7 - files like Windows 2000/XP's Thumbs.db file (Thumbnail cache) and Mac OS X' .DS_Store file (Desktop Services Store), while not being too strict and also not extracting files which just contain 'Thumbs.db' or '.DS_Store' in its filename.
 

My Computer My Computer

At a glance

Windows 7 Ultimate, 64-bit4 GB
OS
Windows 7 Ultimate, 64-bit
Memory
4 GB
Yes, it should work.

Here is a piece from WinRar 4.0 Help file
Files to exclude
File masks and file names to exclude from the archiving operation. Wildcards are supported both in path and name parts of masks. If you need to specify several masks, separate them by spaces. If mask contains spaces, enclose it in quotes. For example, you may enter:

c:\temp\info.txt *.bak *.tmp *\temp\

to skip c:\temp\info.txt file, all .bak and .tmp files, all temp folders and all files in temp folders. You may enter file names manually or use "Append" button to browse for file to exclude.

Detailed information about exclusion masks syntax is provided in description of switch -x. This switch uses the same format of exclusion masks as "Files to exclude" field.
 

My Computer My Computer

At a glance

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Computer type
PC/Desktop
OS
Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)
Other Info
"The scale icon at the top right of a post or tutorial is how you can give rep to the member."
Yes, it should work.

Here is a piece from WinRar 4.0 Help file
Thanks for that!

I have an issue with this not working on certain types of ZIP/RAR/7z files, though.

I've entered `thumbs.db .DS_Store` in the prohibited file list. I have encountered a ZIP file that has a `.DS_Store` file in a 2nd level directory. (Zipfile.zip > Parent Directory > Directory where .DS_Store is stored). When I extract this ZIP file, WinRAR still extracts the `.DS_Store` file. Changing `.DS_Store` to `*.DS_Store` fixes this. The same issue happens with thumbs.db files.

So now, my prohibited files list is now `*thumbs.db *.DS_Store` (without the quotes). Know why the previous entry didn't work in this case? Also, is there a better entry in the Prohibited files list that will work to exclude only thumbs.db and .DS_Store for all directory levels in a ZIP/RAR/7z file?
 

My Computer My Computer

At a glance

Windows 7 Ultimate, 64-bit4 GB
OS
Windows 7 Ultimate, 64-bit
Memory
4 GB
Back
Top