When you save files, such as a PDF or a ZIP file, from a remote location (eg from the internet), Windows tries to protect our machine by blocking it using the Alternate Data Streams (ADS) technology.
To check if a file is blocked, just look at its properties, as shown in the picture below. From here, you can unblock it.
This file came from another computer and might be blocked to help protect this computer.
But what if you want to unblock more than one file in one folder? As long as you know that there is no security issue for these files, you can unblock them all with the help of PowerShell.
Unblock files in a folder using PowerShell
Type the following command to unblock all files in a folder by changing the path of the folder to yours.
Get-ChildItem -Path 'C:\Users\Dimitris\Downloads\' | Unblock-File |
Or for a shortcut, try the following.
gci 'C:\Users\Dimitris\Downloads \' | Unblock-File |
If you want to unblock all files that exist in the sub-folders as well, just add the -Recurse switch.
Get-ChildItem -Path 'C:\Users\Dimitris\Downloads\' -Recurse | Unblock-File |
More about Unblock-File.
Thank you very much!
Works, thank you.
Very helpful. Thank you.
I have one question. Is there a way to list the files that need unblocking? This way I can review that list first.
You can use PowerShell to get all these files for review. For example, running the following command you will get the list of all files that needs unblocking. Zone identifier stores whether the file was downloaded from the internet.
Get-Item * -Stream "Zone.Identifier" -ErrorAction SilentlyContinue
Perfecto, thank you for this information of how to find files blocked that need unblocked using zone.identifier property in the file stream! I already knew the magic unblock phrase, I needed the “which files need unblocked” phrase. I know it seems a bit redundant and if you’re unblocking why not just run the command to unblock, but I needed a test of if it was done or not, and this should be it with a little adjustment knowing it’s the Stream property “Zone.Identifier” with errors that identify. I’m sure there are different kinds of errors but just knowing that there are errors is miles beyond where I was.
Thanks again!
Any suggestions on how to do this for files with a path exceeding the 260 character limit?
Thanks
Sam,
I know that’s an old post and probably beyond your needs now, but hey. In case you still are wondering, there is a 32-bit file system dll that you can search and find on the internet and hack into the registry so the file system will work at longer bit lengths. Pretty sure one of the older Windows 10 updates phased that out though, should just be able to mod the character lengths in registry or GPO now.
I know this is an old post but it just helped me a lot today. 45 years old and I learned something new. Just saved me time cause I just unzipped a 3 gb file I forgot to unblock before. Thanks!