Home > Smart Tip, Windows > Mass unblock Files – remove “This file came from another computer…” warnings

Mass unblock Files – remove “This file came from another computer…” warnings


Scenario : You have downloaded a file online and now whenever you try to run it, you get a security warning. You want to remove the notification from that file and a bunch of other files but do not want to do it one by one.

Solution : On Windows OS, you will find that when you download files to your local drive, they are not trusted until you go to properties and click the ‘Unblock’ button. This is OK for one or maybe two files but more than that and it goes into the “Micro$oft $ucks for not thinking about this feature” zone……and this happens to me more often than not. Usually, I download the usual libs and binaries from sites that I trust. I download it via my browser and open the files from within it, at this point I most likely dont know where the file was downloaded and if it was a zip where i had extracted it. So now if i’m stopped by windows at every step, I get really pissed at it because there is no simple way to unblock all files in a directory tree.

This problem is related to NTFS’s ability to allow alternate data streams. so what we have to do is remove the data streams. So here is a simple method to remove the streams and do a mass unblocking of files : 

1. Download the *Sysinternals* *Streams.exe* from the link below. (Remember to unblock the zip file. :P)
2. Unzip and copy streams.exe to \Windows\System32 or any other directory in your path environment variable. (This is so that when you type the below command, you do not have to point to the location of streams.exe)
3. In a command windows, use ‘cd’ to navigate to your folder. (If you do not want to do this, Hold down Shift and right-click the blocked folder.Select “Open command window here”)
4. Type the command “streams –s –d *.*” and press enter.

Here’s a way to make life even more easier by adding the above command to the context menu(so that you don’t have to type the command everytime.  But for it, you will need to modify the registry) :

Create a new text file and rename it to something like “unblocker.reg”. Copy the below registry script in it :

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

and save the file and then double click the saved file to merge it into the registry.
After this whenever you right-click a file, you can select “Unblock file” in the context menu or you can right-click a folder and select “Unblock files in here”. Easy, right ??
About these ads
  1. Barry
    September 13, 2013 at 2:57 pm

    The reg entry does not seem to work. I found this one: http://community.spiceworks.com/scripts/show_download/678

    Seems to do the trick. I simply removed the path showen there and just kept streams.exe ????

    • September 29, 2013 at 12:13 pm

      The only reason this trick might not work is if you did not copy streams.exe to system32 folder…..that is the only difference between the link you provided and the code i have provided….

  2. James
    December 15, 2013 at 12:17 am

    I have followed your instructions but am still not able to get this to work. I am on Windows 8.1 home edition 64bit. I used the registry changes you made and put it in a file ran it, says it added them. I put the streams file in the system32 file. But when I right mouse click and chose unblock I get the following error: This file does not have a program associated with it for performing this action. Please install a program or, if one already installed, create an association in the Default Programs control pannel. What did I do wrong?

    • December 15, 2013 at 11:37 am

      I guess the method works only up to Win 7…..try this….go to programs and run Powershell 3.0. In that type the foll. command :

      gci “destination path to unblock” | Unblock-File

      I think that should do it….let me know what happens

  3. April 1, 2014 at 12:38 am

    it says there is no program associated with this command

  4. Annie
    April 1, 2014 at 7:05 pm

    Hello, this didn’t work for me on Win 7 Pro. I would like to undo the registry change. Please can you tell me if it’s just a case of deleting the HKEY_CLASSES_ROOT\*\shell\unblockfile key from the registry by right-clicking it and saying ‘delete’. I have never done anything like this before. Many thanks for your time.

    • April 1, 2014 at 8:41 pm

      I am assuming you are the same person who commented before, then i have replied above to you. If not, tell me what the error is that you are getting and we will solve it.

  5. Annie
    April 1, 2014 at 8:48 pm

    Hello Obin, no I am a different person but I am getting the same error as someone above… ‘This file does not have a program associated with it for performing this action, etc’. I also don’t have any facility in the right-click menu to unblock a whole folder with its files – I just see unblockfile when I right-click a single file.

    I would like to know if I can safely delete the registry key. I didn’t check beforehand to see whether there was a similar key to this that just needs to be amended. I don’t really want the command in the right-click menu if it’s possible to remove it and I’m not that techie to start playing around too much with things like this.

    Cheers, Annie

    • April 4, 2014 at 8:16 pm

      Yes, you can safely delete the key….it does not exist on a clean install…let me know if you have any issues….

      • Annie
        April 7, 2014 at 8:27 pm

        Many thanks. I have deleted it and all seems OK.

  6. Tom DiBuono
    May 28, 2014 at 11:26 pm

    The issue with the registry txt above is the quotes and there needs to be new lines before the [ characters here is a fixed registry file if it pastes properly:

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\unblockfile]
    @=”Unblock file”

    [HKEY_CLASSES_ROOT\*\shell\unblockfile\command]
    @=”cmd /c streams -d \”%1\””

    [HKEY_CLASSES_ROOT\Directory\shell\unblockallthefiles]
    @=”Unblock the files inside”

    [HKEY_CLASSES_ROOT\Directory\shell\unblockallthefiles\command]
    @=”cmd /c streams.exe -d -s \”%1\””

  7. Tom DiBuono
    May 28, 2014 at 11:27 pm

    looks like pasting still broke the double quotes. just delete and replace them in your file.

  8. Gene
    August 21, 2014 at 7:07 am

    This worked for me.. I change the /c to /k so that it would keep the window open and changed the \ to \\. You might want to change the path to streams.exe to fit your needs.

    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\unblockfile]
    @=”Unblock file”

    [HKEY_CLASSES_ROOT\*\shell\unblockfile\command]
    @=”cmd /k C:\\ProgramData\\streams.exe -d \”\\\”%1\”\\\””

    [HKEY_CLASSES_ROOT\Directory\shell\unblockallthefiles]
    @=”Unblock the files inside”

    [HKEY_CLASSES_ROOT\Directory\shell\unblockallthefiles\command]
    @=”cmd /k C:\\ProgramData\\streams.exe -s -d \”\\\”%1\”\\\””

  9. October 22, 2014 at 3:13 pm

    Windows 7 Pro

    =========================================
    Windows Registry Editor Version 5.00

    [HKEY_CLASSES_ROOT\*\shell\unblockfile]
    @=”Unblock file”

    [HKEY_CLASSES_ROOT\*\shell\unblockfile\command]
    @=”cmd /k C:\\Windows\\System32\\streams.exe -d \”\\\”%1\”\\\””

    [HKEY_CLASSES_ROOT\Directory\shell\unblockallthefiles]
    @=”Unblock the files inside”

    [HKEY_CLASSES_ROOT\Directory\shell\unblockallthefiles\command]
    @=”cmd /k C:\\Windows\\System32\\streams.exe -s -d \”\\\”%1\”\\\””
    =========================================

    This worked and added the unblocking files option to my right click menu but it is now asking for a program association for it and yes, Streams.exe is just sitting loosely in the System32 folder under C:\Windows as stated in the script above otherwise I don’t think it would’ve added it to the right click menu

  10. October 22, 2014 at 6:48 pm

    In the registry located here(along with the location of the other 3 entries) [HKEY_CLASSES_ROOT\*\shell\unblockfile]

    should I have @=”Unblock file” as the value of the “Default” entry or should there be a new entry there along with the default? Would that be a Key entry or a string value or what exactly?

  1. April 22, 2013 at 3:16 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 69 other followers

%d bloggers like this: