Unblocking files from folders and sub-folders

Scenario: We downloaded application components from the internet. The downloaded components have exes, dlls, msis and many more.

Problem: Right click on the dlls/msis/cab files, and select the properties, under the general tab, following message might appear:

"This file came from another computer and might be blocked to help protect this computer”. This means that the components are blocked and may not install at all.

Solutions:

1. Easiest solution is to click on “Unblock” button and it will unblock it for forever. But, we you have many files in many folders and subfolders, this option will take time and effort.

2. Use PowerShell command to unblock all the files in all the folders and subfolders in single go. I recommend this method, as once it is done successfully, then this problem will not occur even if someone will copy the files to some other location.

PowerShell Method:

1. Run PowerShell Command:

clip_image001

2. Run the command to get the version details: $PSVersionTable.PSVersion

PS C:\Users\<User> $PSVersionTable.PSVersion

clip_image002

3. To run the below command, Major version should be 3 or more. Windows server 2012 has PowerShell version 4 by default.

4. Run the following command to Unblock all the files recursively:

Get-ChildItem <path to your folder> -recurse | Unblock-File

Example:

image

Advertisements