An alternate data stream (ADS) is an additional named stream of data attached to a file or folder on NTFS, stored alongside the file’s main content but invisible to ordinary directory listings and to the file size shown in Explorer. Within Windows storage & file systems, ADS is a core NTFS capability that Windows itself relies on, most visibly to record where a downloaded file came from.
Every NTFS file has at least one stream, the unnamed default data stream that holds what users think of as the file’s contents. An alternate data stream is any further stream with its own name, addressed with the syntax file.ext:streamname. The feature dates back to Windows NT, where it was added partly to store Macintosh resource forks for file sharing with Apple clients.
How NTFS stores alternate data streams
NTFS stores each stream as a separate $DATA attribute in the file’s Master File Table record, and an alternate data stream is simply a $DATA attribute that carries a name. Small streams can be resident, living inside the MFT record itself, while larger ones are non-resident and occupy their own clusters on the volume, exactly like a normal file body.
The full path of a stream has three parts: the file name, the stream name and the attribute type, as in report.docx:notes:$DATA. When the type is omitted, $DATA is assumed. Streams share the file’s security descriptor and timestamps, so permissions cannot be set per stream, and deleting the file deletes all of its streams.
The table below breaks down the parts of the stream naming syntax.
| Part | Example | Meaning |
|---|---|---|
| File name | setup.exe | The file that owns the stream |
| Stream name | Zone.Identifier | Name of the alternate stream |
| Attribute type | $DATA | NTFS attribute holding the bytes |
| Default stream | setup.exe::$DATA | Unnamed stream with main content |
| Full alternate path | setup.exe:Zone.Identifier:$DATA | Complete reference to one stream |
Legitimate uses of alternate data streams
The best-known use of alternate data streams is the Mark of the Web, a stream named Zone.Identifier that browsers and mail clients attach to downloaded files. It records a security zone, where ZoneId=3 means the Internet zone, and often the source URL. Microsoft Defender SmartScreen, Office Protected View and the PowerShell execution policy read this stream to decide how cautiously to treat the file.
Other components and applications store metadata that should travel with a file without changing its contents. The table lists representative examples.
| Stream name | Created by | Purpose |
|---|---|---|
| Zone.Identifier | Browsers, mail clients, archivers | Mark of the Web origin data |
| SmartScreen | Microsoft Defender SmartScreen | Reputation check results |
| WofCompressedData | Compact OS and compact.exe | Compressed file contents |
| AFP_AfpInfo | Services for Macintosh, SMB servers | Mac Finder information |
| com.dropbox.attrs | Sync clients | Sync state for cloud storage |
| Custom names | Backup and indexing tools | Checksums or tags |
Removing the Zone.Identifier stream is exactly what the Unblock option in a file’s Properties dialog and the Unblock-File cmdlet do. This is why an extracted script stops prompting after it has been unblocked.
Viewing and managing streams
Alternate data streams are hidden from Explorer and from a plain dir listing, so dedicated switches or cmdlets are needed to see them. Explorer reports only the size of the default stream, which means a 1 KB text file can carry megabytes of hidden data.
The table summarizes the built-in tools for working with streams.
| Task | Command | Notes |
|---|---|---|
| List streams | dir /r | Shows stream names and sizes in Command Prompt |
| List streams in PowerShell | Get-Item file -Stream * | Returns each stream with its length |
| Read a stream | Get-Content file -Stream name | Outputs stream content as text |
| Write a stream | Set-Content file -Stream name | Creates or replaces a named stream |
| Delete a stream | Remove-Item file -Stream name | Leaves the main content untouched |
| Unblock a download | Unblock-File file | Removes the Zone.Identifier stream |
Sysinternals Streams utility can also enumerate and delete streams recursively across a folder tree, which is useful when auditing a large share.
When streams survive and when they are lost
Alternate data streams exist only on file systems that support them, so they disappear whenever a file leaves NTFS or a compatible system. Windows usually warns that properties will be lost when copying to such a destination, but many tools drop streams silently.
- Kept: copies and moves between NTFS volumes in Explorer, robocopy and most backup tools that use Windows backup APIs.
- Kept with limits: ReFS supports named streams, with size limits that depend on the version.
- Lost: copies to FAT32 or exFAT media such as many USB drives and memory cards.
- Lost: email attachments, most web uploads and many archive formats, although some extractors propagate the Mark of the Web to extracted files.
- Variable: SMB shares on non-Windows servers, depending on how the server maps named streams.
Security risks and common misconceptions
Because streams are invisible in normal views, attackers have long used them to hide payloads and tools on compromised systems, and security monitoring treats unexpected streams as a signal worth investigating. Modern Windows prevents launching an executable from a stream by double-clicking, but several living-off-the-land binaries can still execute stream content.
Attackers also abuse the opposite effect: delivering files in containers that strip the Mark of the Web so that SmartScreen and Protected View never trigger. Security teams therefore check both for hidden streams and for missing ones. The table pairs common misconceptions with the accurate picture.
| Misconception | Reality |
|---|---|
| Streams are a hacking feature | Windows uses them routinely for metadata |
| File size shows all data | Explorer shows only the default stream size |
| Streams need separate permissions | They share the file’s access control list |
| Copying always preserves streams | Non-NTFS destinations discard them |
| Antivirus ignores streams | Modern scanners inspect alternate streams |
Explained without jargon
An alternate data stream is like a hidden pocket sewn inside a file. The file still shows its normal contents, but the pocket can hold extra notes that most programs never look at.
Windows uses this pocket to remember where a file came from. That is why a program downloaded from the Internet triggers a warning, while the same program copied from a colleague’s NTFS drive may not. The key idea is simple: a file on NTFS can carry more than it shows.
A typical use case
A help desk technician receives a ticket from an accountant whose spreadsheet macros refuse to run. The workbook came from an email attachment, and Excel keeps opening it in Protected View with macros blocked.
Running Get-Item budget.xlsm -Stream * in PowerShell shows a Zone.Identifier stream with ZoneId=3, confirming that Windows treats the file as coming from the Internet. After checking that the file was sent by a known internal colleague, the technician removes the stream with Unblock-File. The workbook then opens normally, and the technician notes in the ticket that unblocking should follow a verified sender check, not become a routine reflex.