202

Windows XP SP2 and Windows Vista have this deal where zone information is preserved in downloaded files to NTFS partitions, such that it blocks certain files in certain applications until you "unblock" the files.

So for example if you download a zip file of source code to try something out, every file will display this in the security settings of the file properties

"This file came from another computer and might be blocked to help protect this computer"

Along with an "Unblock" button. Some programs don't care, but Visual Studio will refuse to load projects in solutions until they've been unblocked.

While it's not terribly difficult to go to every project file and unblock it individually, it's a pain. And it does not appear you can unblock multiple selected files simultaneously.

Is there any way to unblock all files in a directory without having to go to them all individually?

I know you can turn this off globally for all new files but let's say I don't want to do that

9
  • 30
    How does one turn this off globally? Link please? :) Thanks
    – underskor
    Oct 5, 2009 at 1:46
  • 19
    Yes, worst Windows "feature" ever... Oct 29, 2009 at 11:41
  • 16
    Second worst. The first worst is auto-run on newfound media, which is what started this mess.
    – kmarsh
    Oct 29, 2009 at 11:47
  • 6
    @Thomas As one of the answers points out, you can do this by setting the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments\SaveZoneInformation = 1. More info: support.microsoft.com/kb/883260 Jan 10, 2013 at 22:28
  • 3
    My downloads in Google Chrome get tagged and I have to unblock them. @jamiebarrow has the right information for disabling this globally via the registry, or you can use the Local Group Policy Editor (gpedit.msc) and change the setting in User Configuration > Administrative Templates > Windows Components > Attachment Manager > Do not preserve zone information in file attachments > Enabled.
    – Baodad
    Jul 22, 2014 at 16:20

15 Answers 15

205

If you download a .ZIP and unzip it, the individual files will be marked as the same zone as the .ZIP. Almost every time I have a folder full of "blocked" files, this is how I got them.

Before unzipping, click the Unblock button on the .ZIP.

10
  • 1
    This one's definitely the easiest - you win
    – Tom Kidd
    Sep 9, 2009 at 16:03
  • +1 same conclusion I came to - an easy way to package files in a non-NTFS manner - found this by searching Google for these terms: unblock all files in a directory xp. Sep 9, 2009 at 18:19
  • 3
    Actually, no. I download zip-files to use the content and I let my browser open the zip file automatically. From there I invoke "Extract all files". There is no option to unblock from these location, and hunting down the zip file in the download folder or even worse, the temp folder, is very tedious. Sep 16, 2010 at 11:29
  • I wish I could upvote this more than once. Jun 1, 2011 at 19:57
  • This solution only works if you haven't modified the files that came out of the ZIP file.
    – Charlie
    Sep 4, 2013 at 19:11
111

PowerShell, available here, has an Unblock-File cmdlet that will do this task for you. To unblock all of the files in a directory, you'd issue the following command.

dir c:\mydir -Recurse | Unblock-File

Unblock-File doc

7
  • 3
    No longer just Beta, this is released and works quite well.
    – Ken Hiatt
    Jul 13, 2013 at 20:12
  • Excellent! I extracted a big zip and forgot to unblock it first, then deleted the zip to save space. This saved me downloading it again or a load of manual work :) Jun 1, 2014 at 12:49
  • 5
    This worked for me but didn't provide any feedback at the cmd line. I also tweaked it slightly, if you're already in the folder then you can just do dir -Recurse | Unblock-File
    – user36088
    Sep 12, 2014 at 2:44
  • 4
    Works like a champ. This should be the accepted answer. Feb 19, 2015 at 7:25
  • 2
    Perfect. This should be the accepted answer. Unblocking the zip is fine and dandy if you remember it, but this method for doing it for a bunch of files all at once is great.
    – Bas
    May 11, 2017 at 11:20
66

It's quite simple, NTFS attached a data stream (that IDs "unsafe files") to the file when it is just downloaded from the Internet.

Do 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 (or anywhere that the system can find it)
  3. Run this line in the command line :

streams -s -d directory

It will then remove all of the data streams from all files recursively in the directory - you have now successfully unblocked all files.

14
  • 10
    Might be dangerous. Windows also uses streams for other purposes.
    – harrymc
    Sep 9, 2009 at 15:41
  • 6
    Very rare - data streams are hardly used for anything since it's an undocumented feature. It will be safe if as schnapple has said - he just wants to unblock files in a certain directory that are known to be documents received over the internet. At no point in time am I recommending him to do _streams -s -d C:_ :)
    – caliban
    Sep 9, 2009 at 15:46
  • 6
    just checked (since Streams is an undocumented feature it's hard to verify though) with some people, and they believe that once a document is transferred over the Internet or go through anything other than NTFS, it loses all stream data. As a result, when you first download something from the Internet, the only data stream you will have is that "Unsafe File" data stream.
    – caliban
    Sep 9, 2009 at 15:54
  • 23
    Why do you think they're not documented? (msdn.microsoft.com/en-us/library/aa364404(VS.85).aspx)
    – Reuben
    Sep 9, 2009 at 16:12
  • 6
    Don't blindly delete all alternate data streams, unless you have backup copies of those NTFS encrypted files.
    – Ian Boyd
    Dec 15, 2009 at 20:51
32

AlternateStreamView can list all alternate NTFS streams for files in a directory (and sub-directories if desired).

Delete all streams marked ":Zone.Identifier:$DATA" for the selected files to get rid of the security blocks.

enter image description here

3
  • 1
    There's another tool for this exact purpose - ZoneIDTrimmer
    – itsho
    Mar 3, 2014 at 7:08
  • @ZoneIDTrimmer - Not sure I understand. What other tool?
    – user66001
    May 11, 2014 at 20:36
  • 7
    ZoneIDTrimmer is the name of the tool, not the alias of the person.
    – Snark
    May 11, 2014 at 21:13
14

A very easy workaround for this kinda ties into the first answer, say if you have around 1000 files that are all blocked just take all the files, and put them in a new folder on your desktop (or whatever folder directory you're working in them right click said folder and then click Send To and then out of the options Click Compressed (zipped) Folder, then after that delete your original files and extract the .ZIP folder and Viola!!! all your files are unblocked :D, worked for me on XP Pro SP3, so kinda assuming it will work on vista as well

2
  • By far the least amount of work. Nice!
    – RomanSt
    Nov 9, 2015 at 14:53
  • Still working well 10 years later on Windows 10. The nice thing about it is that it does not assume the files originated from a ZIP file.
    – Hazem
    Mar 22, 2021 at 19:07
11

To disable blocking when files are downloaded, open the following registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments\SaveZoneInformation

Change SaveZoneInformation to 1.

NOTE:

  • 0 = Not Configured
  • 1 = Enabled
  • 2 = Disabled
6
  • 2
    I don't have that option on windows 7 and article only mentions XP. Still, looks interesting.
    – AndrejaKo
    Dec 31, 2010 at 11:41
  • Can you add the key to enable / disable? Just because you don't have a User Policy key only means that it hasn't been set up that way; you can still use it.
    – JohnZaj
    Jun 13, 2011 at 11:22
  • @user61000 - Am I right in my suspicion this only alters IE's behaviour, and not (as I found out is now done with the latest release of) Firefox (or other) browsers?
    – user66001
    May 11, 2014 at 19:55
  • Requires admin rights :(
    – Quandary
    Jan 8, 2015 at 10:11
  • 1
    This works in Windows 7 and 8 as well (and likely 10). Updated link: support.microsoft.com/en-us/kb/883260. This also affects Chrome and I think Firefox.
    – thaimin
    Aug 15, 2015 at 19:39
8

As another poster said the insecure file flag is stored in an NTFS data stream. What this means is there's a very easy way to remove this data stream, just move the file to a drive that doesn't support NTFS data streams.

Assuming that your problem is more related to the number of files, rather than the size of them, then the easiest way to do it might be to move (not copy) the files to a FAT formatted drive, then move them back to the NTFS drive (almost every USB stick is formatted FAT32 so will do nicely), and then move those files back to where you want them.

I've done this before when I've wanted to strip the blocked flag from a whole directory of downloaded files and it did exactly what I needed.

8
  • Download the Sysinternals Streams utility.
  • Unzip and copy streams.exe to \Windows\System32.
  • 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\""
    
  • Save the file.

  • 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".

source

3
  • +1 Great idea to make this process less time intensive.
    – user66001
    May 11, 2014 at 19:56
  • It worked for me, after I added the path to streams.exe in the 8.3 format: @="cmd /c C:\PROGRA~2\Sysinternals\streams.exe -d -s \"%1\"" Sep 27, 2014 at 16:21
  • I know this is an old thread but thanks. There are multiple versions of the same reg script on the internet and most of them don't work. I can add that this worked for me on Windows 7 professional 64bit.
    – trenten
    Jul 28, 2016 at 18:28
5

AlternateStreamView is great. Another method though is to archive the files to .RAR, 7z or .ZIP . Delete the originals and then re-extract the files.

0
3

I had the same issue and the way I unblocked the files was:

  • I added all the blocked files to a RAR archive (I used WinRAR)
  • I removed the original files
  • I extracted all the files from the archive

All the files are now unblocked.

For me it was some MSDN Magazine issues that were in .chm format, but I do not think the file type matters.

1

ZoneIDTrimmer looks like the most user-friendly tool available for this:

enter image description here

1

I was searching for a batch method (without using powershell) and after reading this post I came up with this simple solution

echo. > .\filename.zip:Zone.Identifier

this will not remove the Zone.Identifier data stream but clear it's content which seems to work fine.

Another solution (which will clear all data streams and use a temporary file is this)

type filename.zip > filename.zip.tmp
move /y filename.zip.tmp filename.zip
0

I have a usb external Hard Drive that works great for removing the blocks... I made a small partition and formatted it in FAT32..when I want to remove the block from something I simply move it to that drive and then move it back :-)

2
  • This is certainly a good approach, but it has already been mentioned in GAThrawn's answer.
    – Dennis
    Feb 18, 2013 at 3:54
  • Possibly the least risky/step intensive out of the workaround answers provided.
    – user66001
    May 11, 2014 at 19:58
-4

Yes. At a command prompt, takeown /f <name of file>.

In your case, takeown /f *.* /r to recurse into all sub-directories and unblock *.*. Play with the pattern if necessary.

takeown /? for more usage instructions.

1
  • 1
    How shall that help? Jan 22, 2014 at 10:28
-5

There is another easy way. Just select the file or the folder, right click it and select Properties⇨Security⇨Edit, then click on Full Control.

After that you should just click [Save] and exit.

2
  • 2
    This is not the place where Windows stores the information that the file comes from another computer. Jan 22, 2014 at 10:30
  • Agree Werner Henze. Pity, though - like shreyas 's effort with the unicode arrows.
    – user66001
    May 11, 2014 at 20:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .