If you downloaded the file from the internet, either separately or inside a .zip file or similar, it may have been "locked" because it is flagged as coming from the internet zone. Many programs will use this as a sign that the content should not be trusted.
The simplest solution is to right-click the file in Windows Explorer, select Properties, and along the bottom of this dialog, you should have an "Unblock" option. Remember to click OK to accept the change.
If you got the file from an archive, it is usually better to unblock the archive first, if the file is flagged as coming from the internet zone, and you unzip it, that flag might propagate to many of the files you just unarchived. If you unblock first, the unarchived files should be fine.
There's also a Powershell command for this, Unblock-File:
> Unblock-File *
Additionally, there are ways to write code that will remove the lock as well.
From the comments by @Defcon1: You can also combine Unblock-File
with Get-ChildItem
to create a pipeline that unblocks file recursively. Since Unblock-File
has no way to find files recursively by itself, you have to use Get-ChildItem
to do that part.
> Get-ChildItem -Path '<YOUR-SOLUTION-PATH>' -Recurse | Unblock-File
None of these answers worked for me, I had to do the following:
Source: https://superuser.com/q/44503
Complementing @lasse-v-karlsen answer. To unblock all files recursively, run from powershell as administrator inside the folder you want:
gci -recurse | Unblock-File
source link:
How to Unblock Files Downloaded from Internet? - Winhelponline
https://www.winhelponline.com/blog/bulk-unblock-files-downloaded-internet/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With