Workflow Tools Control Yard

Home / Windows

Zone.Identifier reader

Windows marks a file from the Internet with a hidden stream named Zone.Identifier, the Mark of the Web: a few lines with the zone the file came from and, from Windows 10 on, the address it was downloaded from. Paste the stream's text to read it, and get the commands that show it and take it off.

Show it, and take it off

In order: Notepad opens the stream itself; Get-Content -Stream prints its text in PowerShell; dir /r in Command Prompt lists the file's streams, as report.xlsm:Zone.Identifier:$DATA (file, stream, stream type); Unblock-File takes the stream off, the same as the Unblock box on the General tab of the file's Properties, and is Microsoft's recommended way once the file and its source are checked; Remove-Item -Stream deletes the stream too. The page writes -LiteralPath so that brackets in a name are not read as wildcards. To list the files in the current folder that have the stream: Get-Item * -Stream "Zone.Identifier" -ErrorAction SilentlyContinue.

The lines

LineMeaning
[ZoneTransfer]The heading the values sit under.
ZoneIdThe zone the file came from, from the table below. A browser download from the Internet gets 3.
ReferrerUrlThe page that linked to the file, when the browser knew one.
HostUrlThe address the file was downloaded from. Chromium writes about:internet instead when the address was not valid, was not HTTP or HTTPS, was too long, or the download came from a private window.
LastWriterPackageFamilyNameThe Store app that last wrote the file.
AppDefinedZoneIdA zone that app suggests; it is cleared when a different app writes the file.

By default only files from the Internet and Restricted sites zones get the mark, and only on NTFS: a file saved to a FAT32 drive has none. A file that the OneDrive sync client downloads has none either.

Zones

ValueZoneConstantMeaning
-1InvalidURLZONE_INVALIDNo zone: used only when none fits.
0My ComputerURLZONE_LOCAL_MACHINEContent that is already on this computer.
1Local intranetURLZONE_INTRANETContent from the intranet.
2Trusted sitesURLZONE_TRUSTEDTrusted web sites on the Internet. Office does not block VBA macros in a file from this zone by default.
3InternetURLZONE_INTERNETMost of the Internet. By default Windows marks files from this zone, and Office blocks VBA macros in them.
4Restricted sitesURLZONE_UNTRUSTEDWeb sites that are not trusted. By default Windows marks files from this zone too.
999Predefined maximumURLZONE_PREDEFINED_MAXZones 0 to 999 are predefined.
1000User minimumURLZONE_USER_MINThe lowest user-defined zone.
10000User maximumURLZONE_USER_MAXThe highest user-defined zone.

Sources

More Windows tools