How to Exclude System Volume Information in 7-Zip

When creating full backups of entire drives or partitions, 7-Zip often attempts to compress hidden Windows folders like "System Volume Information" and "$RECYCLE.BIN", which frequently triggers "Access is denied" errors and inflates archive sizes. This guide explains how to configure 7-Zip to ignore these system and recycled directories using exclusion parameters in both the graphical interface and the command-line tool.

Method 1: Using the 7-Zip Graphical User Interface (GUI)

You can exclude specific folders during manual compression using the Parameters field in the 7-Zip creation window:

  1. Select the files or drives you want to compress, right-click, and choose 7-Zip > Add to archive....
  2. In the "Add to Archive" window, locate the Parameters: field near the bottom.
  3. Enter the following exclusion switches into the field:
    -xr!"System Volume Information" -xr!"$RECYCLE.BIN" -xr!"Recycled"
  4. Click OK to begin compressing. 7-Zip will bypass the designated folders across the entire directory tree.

Switch breakdown:

  • -x: Tells 7-Zip to exclude filenames or paths.
  • r: Recurses through all subdirectories to apply the exclusion pattern everywhere.
  • ! : Precedes the target folder or file name pattern. Quotes ensure folders with spaces are processed correctly.

Method 2: Using the 7-Zip Command Line (7z.exe)

If you automate backups using batch files or PowerShell scripts, add the -xr! parameter directly to your command:

7z.exe a -r "C:\Backups\DriveBackup.7z" "D:\*" -xr!"System Volume Information" -xr!"$RECYCLE.BIN" -xr!"Recycled"

Method 3: Using an Exclusion List File

If you manage a large list of folders and system files to ignore, you can store them in a plain text file:

  1. Create a text file named exclude.txt.
  2. Add the folder names on separate lines:
    System Volume Information
    $RECYCLE.BIN
    Recycled
    pagefile.sys
    hiberfil.sys
  3. Run 7-Zip referencing the exclusion file with the -xr@ switch:
    7z.exe a "C:\Backups\DriveBackup.7z" "D:\*" -xr@exclude.txt
    Or in the GUI Parameters box, enter:
    -xr@"C:\path\to\exclude.txt"