Can 7-Zip Preserve Windows Alternate Data Streams?

7-Zip has the capability to archive and restore Windows Alternate Data Streams (ADS), but it does not do so by default. Users must explicitly enable this functionality through specific parameters, as standard compression settings strip away alternate stream metadata to maintain cross-platform compatibility and reduce file size. This guide outlines how 7-Zip handles NTFS alternate streams, the supported archive formats, and the exact methods required to preserve this data during compression and extraction.

Default Behavior and Supported Formats

By default, 7-Zip ignores NTFS Alternate Data Streams and only packages the primary unnamed data stream of a file. When an archive is extracted, metadata stored in alternate streams—such as Zone.Identifier markers, custom application tags, or file classifications—is permanently lost.

To preserve alternate streams, you must use an archive format that supports them. The native .7z format and the .wim format both support NTFS alternate streams. Legacy formats like standard .zip or .tar do not support this feature reliably within 7-Zip.

Preserving Streams Using the Command Line

The most straightforward way to archive files with Alternate Data Streams is through the 7-Zip command-line tool (7z.exe) using the -sns (Store NTFS streams) switch.

To create an archive with ADS preserved:

7z a -sns archive.7z C:\path\to\folder

To extract the archive and restore the streams to an NTFS-formatted destination:

7z x -sns archive.7z -oC:\path\to\destination

If you do not include -sns during extraction, 7-Zip may ignore the alternate streams stored within the .7z file and only extract the primary data stream.

Preserving Streams Using the Graphical Interface (GUI)

You can also preserve alternate streams directly from the Windows GUI:

  1. Right-click the file or folder you want to compress and select 7-Zip > Add to archive...
  2. Ensure the Archive format is set to 7z.
  3. In the Parameters text box located in the bottom-left area of the window, type:
    sns=on
  4. Click OK to create the archive.

When extracting through the GUI, open 7-Zip File Manager, navigate to the archive, and ensure the target volume is formatted as NTFS. Non-NTFS file systems (such as FAT32 or exFAT) do not support Alternate Data Streams, causing the streams to be dropped upon extraction regardless of your settings.