Sign in with
Sign up | Sign in
Your question

Setting WinRAR to exclude specified files from being extracted in Win7

Tags:
Last response: in Windows 7
Share
April 23, 2011 2:59:45 AM

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:

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


while files with these filenames should be extracted:

Quote:
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.
June 20, 2011 3:35:29 AM

Entering only 'thumbs.db .DS_Store' (without quotes) in the WinRAR prohibited file list, only excludes thumbs.db and .DS_Store in the root directory and not in a 2nd level or deeper directory. 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 in the prohibited files list fixes this. The same issue happens with thumbs.db files.

My prohibited files list is now '*thumbs.db *.DS_Store' (without quotes). While this could exclude *thumbs.db and *.DS_Store in all directories, my concern is that this could also affect filenames that I do not intend to exclude (e.g. SampleThumbs.db or Sample.DS_Store).

Is there an entry in the Prohibited files list that will work to exclude only thumbs.db and .DS_Store files for all directory levels in a ZIP/RAR/7z file, or at least a better one than 'thumbs.db .DS_Store' (without quotes)?
a c 209 $ Windows 7
June 20, 2011 4:05:35 AM

If you run WinRAR using a command line you can specify an "exclude file" using the "-X" option. That lets you specify a text file in which you identify files to be excluded using wildcards - WinRAR compares the entire full path of the filename to the wildcarded names in the file so the exclusions work for files at any level of the directory.

Full details of the command line options are available in the WinRAR help file.
!