Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question
22  
How does one turn this off globally? Link please? :) Thanks –  Thomas Oct 5 '09 at 1:46
9  
Yes, worst Windows "feature" ever... –  Brian Knoblauch Oct 29 '09 at 11:41
8  
Second worst. The first worst is auto-run on newfound media, which is what started this mess. –  kmarsh Oct 29 '09 at 11:47
4  
@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 –  jamiebarrow Jan 10 '13 at 22:28
1  
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 at 16:20

15 Answers 15

up vote 103 down vote accepted

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.

share|improve this answer
1  
This one's definitely the easiest - you win –  Schnapple Sep 9 '09 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. –  Will Bickford Sep 9 '09 at 18:19
2  
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. –  Thomas Eyde Sep 16 '10 at 11:29
    
I wish I could upvote this more than once. –  dave thieben Jun 1 '11 at 19:57
    
This solution only works if you haven't modified the files that came out of the ZIP file. –  Charlie Sep 4 '13 at 19:11

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.

share|improve this answer
7  
Might be dangerous. Windows also uses streams for other purposes. –  harrymc Sep 9 '09 at 15:41
2  
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 '09 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 '09 at 15:54
17  
Why do you think they're not documented? (msdn.microsoft.com/en-us/library/aa364404(VS.85).aspx) –  Reuben Sep 9 '09 at 16:12
4  
Don't blindly delete all alternate data streams, unless you have backup copies of those NTFS encrypted files. –  Ian Boyd Dec 15 '09 at 20:51

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

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

In the forthcoming Powershell 3 release, available in Beta here, there is 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 on MSDN

share|improve this answer
    
No longer just Beta, this is released and works quite well. –  Ken Hiatt Jul 13 '13 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 :) –  Danny Tuppeny Jun 1 at 12:49
    
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 at 2:44

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.

share|improve this answer

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

share|improve this answer
    
thanks for this pragmatic solution –  Ben May 22 '11 at 12:24

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.

share|improve this answer

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
share|improve this answer
1  
I don't have that option on windows 7 and article only mentions XP. Still, looks interesting. –  AndrejaKo Dec 31 '10 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. –  jJack Jun 13 '11 at 11:22
    
Thank you, this works perfectly. –  jamiebarrow Jan 10 '13 at 22:26
    
@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 at 19:55
  • 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

share|improve this answer
    
+1 Great idea to make this process less time intensive. –  user66001 May 11 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\"" –  Olivier Jacot-Descombes Sep 27 at 16:21

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.

share|improve this answer

as per the zip idea

I just zipped them all into a zip file, made sure the zip file was unblocked (it was) and then unzipped them all.

The unzipped files were now all unblocked!

share|improve this answer

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 :-)

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

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

enter image description here

share|improve this answer

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.

share|improve this answer
1  
How shall that help? –  Werner Henze Jan 22 at 10:28

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.

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

protected by Community Apr 21 at 9:38

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.