7-Zip Insists on Compressing Recycle Bin 000 Root Folders
When using 7-Zip, a popular file compression and archive utility, you may encounter an unusual situation where it insists on compressing the $RECYCLE.BIN folders located in the root of your drives.
This article will explain this behavior in detail and provide guidance on how to handle it.
Understanding Recycle Bin Folders
The Recycle Bin in Windows is a holding area for deleted files.
Each drive on your system has its own $RECYCLE.BIN folder.
When you delete a file, it is moved to the corresponding Recycle Bin folder.
These folders are hidden by default, and they contain several subfolders, each named with a unique identifier (GUID). These subfolders store the deleted files for each user account on the system.
Why Does 7-Zip Include Recycle Bin Folders?
When you attempt to compress a drive or folder using 7-Zip, the utility includes all the files and folders in the selected location, including the hidden Recycle Bin folders. This behavior is because 7-Zip doesn't exclude hidden or system files by default.
Compressing these folders can result in large archive sizes due to the accumulation of deleted files. Additionally, including these folders can be unnecessary, as their contents can often be redundant or irrelevant.
How to Exclude Recycle Bin Folders
To exclude Recycle Bin folders from compression, you can utilize 7-Zip's file exclusion feature. This enables you to specify a list of files or folders to exclude from the compression process.
"C:\Program Files\7-Zip\7z.exe" a -xr!$RECYCLE.BIN E:\elec\teste11.7z *.*
In the example above, the -xr!$RECYCLE.BIN option tells 7-Zip to exclude the $RECYCLE.BIN folder from the compression process.
Additional Recommendations
-
Consider using a different exclusion pattern to exclude all hidden or system files, such as
-xr!*.* -xr!@*.*. Note that this approach could potentially exclude important files, so it should be used with caution. - It's a good practice to periodically empty the Recycle Bin to minimize the disk space occupied by deleted files.
References
- Book: Pro 7-Zip by Jan Kneschke (Apress, 2009)
- Article: 7-Zip Command Line Version - Official documentation for using 7-Zip from the command line.