Unblock a downloaded file on Windows

Remove the Mark of the Web from downloaded files with Unblock-File.

WindowsFilessecuritypowershellMedium risk
Run `Unblock-File -Path "文件路径"` (e.g. for a downloaded installer) to clear the blocked mark Windows added.

01Command

Command
$ Unblock-File -Path "C:\Users\me\Downloads\setup.exe"

02What it does

Files saved from browsers and email carry a hidden Zone.Identifier tag — the Mark of the Web — which makes Windows show 'This file came from another computer' warnings and can block scripts entirely. Unblock-File deletes that tag, and `Get-Item file | Select-Object -ExpandProperty Stream` first shows whether it is present. In an elevated terminal, `Unblock-File -Path "C:\Tools\*"` clears a whole folder at once.

03Risk

RiskMedium risk
!Warning: Only unblock files from sources you trust — the mark is part of how Windows and Microsoft Defender stop scripts downloaded from the internet from running unchecked.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Unblock-File
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Unblock-File removes the Zone.Identifier alternate data stream (Mark of the Web) that Windows adds to files downloaded from the internet.
  • Reg - Read and edit the registry
    SS64 · technical · 2026-09-17
    Evidence: reg query can inspect the Zone.Identifier stream information stored for downloaded files.

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions