How to Unblock a file or many files

email me

The error: “This file came from another computer and might be blocked to help protect this computer”

The reason you receive this message is because Windows has detected a file came from a different computer (so, you’re receiving it for your protection). However, this Blocking, which has to be Unblocked, can be quite annoying if you have multiple blocked files.  I did some research, and have listed different solutions for handling blocked files.

If the file is a compressed file
Before unzipping, click the Unblock button on the .ZIP, or .RAR, etc.

 

PowerShell: link
dir c:\mydir -Recurse | Unblock-File

or

Unblock-File .\MyFile.PDF

 

Streams from Microsoft

To recursively remove this stream for all files, follow these steps :

1. Download the Streams CLI executable from Microsoft

2. Put the streams.exe executable in your Windows directory

3. Run this line in the command line:  streams -s -d directory

 

Adding this reg key to your registry will give you the ability to right-click and unblock

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\unblockfile]

@=”Unblock file”
[HKEY_CLASSES_ROOT\*\shell\unblockfile\command]
@=”cmd /k streams -d \”%1\””
[HKEY_CLASSES_ROOT\Directory\shell\unblockallthefiles]
@=”Unblock the files inside”
[HKEY_CLASSES_ROOT\Directory\shell\unblockallthefiles\command]
@=”cmd /k streams.exe -d -s \”%1\””

 

Or, for Widnows 8

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\powershell] @=”Unblock Files”
[HKEY_CLASSES_ROOT\*\shell\powershell\command] @=”C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe
Unblock-File -LiteralPath ‘%L'”

Also, just for fun, check out SysInternals.

 

References

http://answers.microsoft.com/en-us/windows/forum/windows_7-security/windows-7-security-blocks-potentially-harmful-file/4f9a3014-06bc-46e6-802c-154f3de1ea38

http://www.thewindowsclub.com/fix-windows-blocked-access-file

http://blogs.technet.com/b/heyscriptingguy/archive/2012/09/14/easily-unblock-all-files-in-a-directory-using-powershell.aspx