How to Unblock Multiple Files on Windows With PowerShell


Release Windows’ grip on your files with a PowerShell command.

So you’ve downloaded files onto a directory on your PC, but Windows doesn’t trust them? This is understandable because some files from the internet can harm your computer, but what if you know for sure that the files are safe? Luckily there’s an easy PowerShell command you can use to unblock all of them.

How Do I Unblock Multiple Files Using PowerShell on Windows?

You can easily unblock a file by right-clicking on it and going to Properties — If you’re on Windows 11, you’ll need to click Show more options first before you can see the Properties option in the context menu. And once you’re there, select the General tab and tick Unblock at the bottom in the Security section.

unblocking a file in Properties on Windows 11

But what if you have more than one file you need to unblock? Doing this one by one can get tedious. Alternatively, you can execute a single PowerShell command to unblock multiple files in a directory. Here is the command structure you need to use:

 dir [path] | unblock-file -confirm 

Just replace path in the square brackets with the file path of the directory that has the blocked files. You can grab the file path of the directory by right-clicking on it and selecting Copy as path.

copying file path on Windows 11

With the file path handy, follow the instructions below to use the unblock command in PowerShell:

  1. Press Win + S to open Windows Search.
  2. Type powershell in the search box and when the program appears in the search results, right-click on it and select Run as administrator. For more ways to open it, please read our guide on ways to open PowerShell on Windows.
  3. Enter the unblock command in PowerShell and hit the Enter key to run it. This is what it looks like on our computer:
    entering the unblock file command in PowerShell on Windows 11

  4. You will be asked to confirm each file you want to unblock, so type either Y for Yes or N for No and hit the Enter key. This confirmation step is due to the -confirm portion of the command. It is completely optional, and you can omit it or type A to confirm all the files in the directory.
    confirming files to unblock in PowerShell on Windows 11

There’s a way you can tell Windows to always trust files you download from the internet. To do that, please read our guide on how to stop Windows 10 from blocking your downloaded files. The instructions in the tutorial use the Registry Editor and Local Group Policy Editor, so they should also work on Windows 11.

Now You Know How to Unblock Files You Know Are Safe

With the instruction above unlocking a bunch of downloaded files in a directory should be easier. Keep in mind that you shouldn’t do this on files you don’t trust. The last thing you want to do is put your Windows PC at risk unnecessarily


Source link

Leave a Reply

%d bloggers like this: