Windows Defender SmartScreen is a crucial security feature that prevents users from running unrecognized or malicious executables downloaded from the internet. When you try to run an obscure setup file, it halts the execution and displays a giant blue “Windows protected your PC” warning.
However, if you are a software developer writing your own un-signed scripts, or if you regularly download custom, niche tools from GitHub, having to manually click “More Info” and then “Run Anyway” on every single file becomes incredibly tedious. Even worse, if you are writing an automated batch script that needs to execute a downloaded tool, the SmartScreen prompt will completely block the automation, waiting endlessly for human interaction.
You can instantly strip the SmartScreen protection off of any specific file using a single line of PowerShell.
Understanding the “Mark of the Web”
When you download a file via a web browser, Windows automatically attaches a hidden alternate data stream to the file known as the “Mark of the Web” (MotW). This invisible tag is what tells SmartScreen: “Hey, this file came from the internet, you need to scan it and warn the user!”
To disable SmartScreen for a specific file, you don’t actually turn off Windows Defender. Instead, you simply delete this hidden “Mark of the Web” tag. Once the tag is gone, Windows assumes the file was created locally on your hard drive and allows it to run without any warnings.
Step 1: Open PowerShell
- Press the Windows Key, type PowerShell, and press Enter. (You do not need to run it as an Administrator unless the file you are modifying is locked in a system folder).
Step 2: Use the Unblock-File Command
PowerShell has a dedicated command specifically designed to remove the MotW tag.
- Type the following command, but do not press enter yet:
Unblock-File -Path "C:\Path\To\Your\DownloadedFile.exe" - Replace the path in the quotation marks with the actual, full path to your file. (A quick trick is to right-click your downloaded file in File Explorer and select “Copy as path”, then paste it into the PowerShell window).
- Press Enter.
How to Unblock an Entire Folder
If you downloaded a massive ZIP archive containing 50 different executable tools, extracting it will often apply the Mark of the Web to every single extracted file. Running the command 50 times is inefficient.
You can unblock an entire directory of files at once by using the wildcard (*) operator.
Unblock-File -Path "C:\Users\YourName\Downloads\MyCustomTools\*"
When you press Enter, PowerShell will instantly strip the SmartScreen warning off every single file inside that folder simultaneously.