/
/

How to Unblock a File in Windows 10 and Windows 11

How to Unblock a File in Windows 10 and Windows 11 blog banner image

This tutorial includes step-by-step instructions on how to unblock a file in Windows 10 and Windows 11 that have been blocked by the Windows Attachment Manager or Windows Defender SmartScreen. Multiple methods are described, including using the file properties dialog and PowerShell to help you unblock files.

What you need to know before you attempt to unblock a file in Windows 10 or Windows 11

In Windows 10 and Windows 11, security features such as the Windows Attachment Manager and Windows Defender SmartScreen may block you from opening a file received as an email attachment or downloaded from the internet if it is deemed a security risk.

These built-in Windows security tools attach information about the source of a file to it when it is saved as an alternative data stream (ADS). Downloaded files are categorized as high, moderate, or low risk based on their file type and source. This may result in you being unable to open a file – instead receiving a warning.

Generally, it is wise to heed these warnings. However, there are situations where legitimate software or files may be blocked, such as opening files from trusted external sources or running third-party software from small developers or in-house tools. Once you have confirmed the authenticity and safety of a file (including its source), you can proceed to unblock it so that you can open or run it.

If you regularly deal with files sent to you from external sources, you should perform regular anti-malware scans and back up your device regularly as a precaution

Unblocking a file in Windows using the File Properties dialog

To unblock a file that has been blocked by Microsoft Defender SmartScreen or the Windows Attachment Manager, follow these steps:

  • Right-click on the blocked file on your desktop or in Windows Explorer, and select Properties.
  • Ensure the General tab is selected at the top of the dialog
  • Under the Security details in the general tab, click to check the Unblock checkbox

testfile Properties window

  • Click the OK or Apply button in the Properties dialog to complete unblocking the file
  • You may be prompted by User Account Control (UAC) to confirm or enter your administrator user credentials

Note that if the option to unblock is not present, then the file is not blocked, and there is no action to be taken.

Unblocking a file when opening it using the security warning prompt

You can also unblock a file at the time you open it by confirming that you do want to open or run it by using the security warning prompt (if it is displayed):

  • Attempt to open the blocked file by double-clicking, running, or opening it
  • You will see a security warning prompt asking whether you want to open the file or run the software
  • Uncheck the checkbox for Always ask before opening this file
  • Click Open or Run to continue opening the file and unlock the file for future use

Again, you may be prompted for administrator credentials if the file is in a location you do not have permissions to modify.

Unblocking a file in Windows Defender SmartScreen settings

If a file or app has been blocked by Windows Defender SmartScreen, it can be unblocked when you try to open it by:

  • Attempt to open the block file or app
  • Click on More info in the Windows Smart Screen prompt that warns it prevented an unrecognized app from starting
  • Click the Run anyway button to unblock and run the file

Unblocking a single file in Windows PowerShell

To unblock a single file using PowerShell on any version of Windows 10 or Windows 11, follow these instructions:

  • To open PowerShell in Windows 11, right-click on the Start button and click Terminal (in Windows 10, select Windows PowerShell instead)
  • Alternatively, to unblock files that you do not have permission to modify as the current user, open PowerShell as an administrator by right-clicking on the Start button and either clicking Terminal (Admin) in Windows 11, or Windows PowerShell (Admin) in Windows 10
  • Enter the command Unblock-File -Path “PATH_TO_FILE” (replacing PATH_TO_FILE with the path to the file you want to unlock) and press the Enter key to execute it

If you experience issues unblocking a file using PowerShell, ensure you have the correct privileges to modify the file and that the file path is correct.

Unblocking multiple files in Windows PowerShell

You can also unblock all files in a directory using PowerShell:

  • Follow the steps above to open PowerShell as either the current user or an administrator
  • Navigate to the directory that contains the files you want to unblock
  • Run the PowerShell command Get-ChildItem “.” | Unblock-File (if the files are in a different directory, replace the period with the path to that directory)

Windows PowerShell
Note that you should take caution when running PowerShell commands that will affect multiple files, as it will make changes without prompting for confirmation.

Unblocking all files in a folder and its sub-folders using Windows PowerShell

Windows PowerShell is a powerful automation tool that allows you to recurse through directories and unblock all files in a folder and its subfolders:

  • Follow the steps above to open PowerShell as either the current user or an administrator
  • Locate the directory that contains the files you want to unblock
  • Run the PowerShell command Get-ChildItem “PATH_TO_FOLDER” -recurse | Unblock-File (replacing PATH_TO_FOLDER with the full path to the folder which contains the files and subdirectories you wish to unblock)

Remotely supporting users, no matter what device they use or where they are

Mobile Device Management (MDM) by NinjaOne allows you to remotely support users, including helping them determine the security of files and unblocking them if they are safe. It also allows you to remotely backup devices in case of a malware infection and remotely monitor for unauthorized access or suspicious behavior.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).