Welcome to MSDN Blogs Sign in | Join | Help

Tips: Streams, Zones, Vista and Blocked Files in IE

4/07/2007 Update

Rick O'Dell and Phil C. both emailed solutions for XP (Yes it happens in XP as well) and Vista that will prevent alternate streams from being saved period.

  1. Open a cmd window.
  2. gpedit.msc
  3. Goto: User Configuration > Administrative Templates > Windows Components > Attachment Manager
  4. Enable: Do not preserve zone information in file attachments.

Note: This won't remove alternate streams from existing files. Also this 'might' have side effects so use with caution. You can always disable the removal policy if you run into any issues.

---------------------------------------------------------------------------------.

Today was one of those not fun days where I lost literally hours and hours trying to overcome file blocking issues in Vista. Fortunately it has a happy ending and through the help of one of our awesome developers I was able to work through the problem. I am writing this in order to spare other the pain should they encounter the same issue.

As part of our courseware development we use an internal tool that allows us to review course content. This tool uses an embedded IE browser for preview. The files that are opened in the browser are HTML pages that include references to JS files and .HTC files. Today I installed this tool on Vista and then copied the generic course template files down from our courseware SharePoint site. As I ran the course for the first time, I got the following message.

I then went via explorer to find the file that it was attempting to open and I noticed in the property window "This file came from another computer and might be blocked to help protect this computer".

Before I pressed the "Unblock" button I went and then multi-selected all the files in the folder in hopes that I could unblock all of them in one fell swoop. That certainly sounded like a good idea, but when I went to the property window for the multiple files….no dice. I then decided to press the unblock button and rerun my app. That actually worked the only problem was that I had about 60 such files that needed to be unblocked, so the app just gracefully moved to error out on the next file. As I realized the implications of what I was seeing I had two thoughts. My first thought was to totally lose it J. My second thought was to stay calm and see if there's a way I can work through this problem. I first send an email off to one our internal Vista distribution lists to see if anyone could help me. I then spent the next several hours trying everything from toying with IE settings, taking ownership of files, launching the application elevated with Admin permissions, even disabling UAC didn't work. I did several searches on the internet to see if anyone else was experiencing the same issues. To my surprise I found several users running Windows XP SP2 exhibited this behavior. None found a solution other than pressing the "Unblock" button for each file.

To make matters worse after being unsuccessful in all my attempts I received an email from Yevgeniy one of our devs that said "No there is no way to multi-select and unblock them all. You have to do it one at a time. Sorry." Now I really felt in between a rock and a hard place. I then took the matter offline with Yevgeniy and explained to him my situation and why I needed a better solution. Yevgeniy explained to me that the reason this error is occurring is that when you download files from the internet windows appends a "Zone Identifier" alternate data stream (supported in NTFS) to each file. If it's an archive, then when you expand it each file within will also have the identified appended. The Windows shell is aware of this stream and this is the reason why the message gets displayed in the file properties dialog. Once you "Unblock" the stream is removed. IE is also aware of this alternate stream and it won't allow any code / .htc files to execute if they have the stream appended. Through further prodding and investigation (Me prodding for a tool / hack and Yevginiy investigating) we found out there actually is a solution, and it's called "Streams". This nifty command line utility both retrieves and removes alternate stream information from files. Fortuanately it also supports a recursive mode where it will hit all the sub folders as well. After downloaded this little beauty I ran the following command from the shell : (-d for delete, -s for sub directories)

Streams –d –s c:\MSLDepot

Problem solved!

Published Tuesday, December 19, 2006 6:44 AM by Glenn Block
Filed under: , , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

You are so awesome, thanks for the tip!

Sunday, December 24, 2006 5:58 AM by blue

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

If you have a USB flash drive that is formatted with FAT, another solution is to copy the files to the flash drive and back. The alternate data streams can't be saved to FAT so get dropped.

Friday, March 02, 2007 1:25 PM by Peter

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Thanks Peter. Actually solution if it is an archive / zip is to unblock the zip file BEFORE you extract it.

Friday, March 02, 2007 1:28 PM by Glenn Block

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Here is a script to do bulk unblocking without having to trust somebodies EXE file. Just save the following as UNBLOCK.JS and type UNBLOCK.JS on the command line.

// Script to "UNBLOCK" all files in the current directory by pete.at.redtitan.com

// (c) RedTitan Technology 2007

// http://www.pclviewer.com

var shell=new ActiveXObject("WScript.Shell");

fso=new ActiveXObject("Scripting.FileSystemObject");

var total=0;

var f=fso.GetFolder('.');              // Current folder

var fc=new Enumerator(f.files);

for (; !fc.atEnd(); fc.moveNext()){

 var fileName=fc.item().Name+':Zone.Identifier';

 try

 {

   f1 = fso.OpenTextFile(fileName,2); // If the Zone Identifier does not exist ..

   total++;

   f1.Close();

 }

 catch(e){}                           // .. we don't care

}

shell.Popup('Unblocked '+total+' files');

Wednesday, March 07, 2007 12:46 PM by Peter Henry

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Dude, you rock! You just saved us some major headache!

Friday, March 09, 2007 5:47 PM by Chris

# re: Tips: Steams, Zones, Vista and Blocked Files in IE

hi glenn, can u please direct me to the download site for "streams"? im still having a blocked file headache...

Monday, April 09, 2007 10:29 PM by mark

# re: Tips: Steams, Zones, Vista and Blocked Files in IE

aww.. never mind.... i just overlooked, it was a hyperlink all the time... thanks!

Monday, April 09, 2007 10:32 PM by mark

# re: Tips: Steams, Zones, Vista and Blocked Files in IE

hi, streams did not help me... i just noticed, i dont have the unblock option in my file's general property. what can i do?

Monday, April 09, 2007 10:38 PM by mark

# re: Tips: Steams, Zones, Vista and Blocked Files in IE

It won't be on every file. Only certain types of files. Try the parent folder. If you got the file from a zip, then try right clicking on the zip and setting the unblock. Then when you unzip it will have the alternate streams removed.

Tuesday, April 10, 2007 2:13 AM by Glenn Block

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

This is horrible news for backing up. I run XP SP2 and have discovered that a lot of files have RECENTLY been associating themselves with this block. I'm talking files on my PC from April 2005. They weren't blocked originally. I have just spent a good half hour unblocking around 300 files.

The reason I needed to unblock? I had some issues with me DVD recorder and had to update the firmware and my preferred software doesn't recognize it and I'm too cheap to upgrade. So I'm using a one-button backup solution. Problem? The backup skips protected files. I have tens of thousands.

I just think this is stupid. :/

Saturday, July 07, 2007 11:47 PM by ixnay

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Thanks Peter Henry and Glen Block

Both the Jscript and the "Streams" utility work great.

Thursday, July 19, 2007 11:24 AM by Victor Rodrigues

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Awesome utility and explanation.  saved me hours of work.

Wednesday, August 01, 2007 1:54 PM by PlumeDeNom

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

It was helpfull to us to unlock some 1000+ files, Thanx.

Friday, September 14, 2007 2:02 AM by Kay

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

@Victor, PlumDeNom, and Key

Glad the utility helped.

Saturday, September 22, 2007 9:03 AM by Glenn Block

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

OK, so what if I can't open the streams.zip file because it's blocked?

I click "unblock" on my zip files, but still can't copy to another directory.  Vista deletest them shortly after copying them.  Streams.zip didn't even have the unblock button.

I find it hard to believe that MS would come out with an OS that prevents users from opening files downloaded from the internet.  Does this not seem a touch odd to anyone else?  What do less technical users (the other 4 billion) do?

Friday, October 19, 2007 8:04 PM by Glenn

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Hey, any way to make that script recursive?  Somehow we have ended up with an entire tree blocked.

Tuesday, January 22, 2008 2:21 PM by Jeff Strubberg

# Unit Test Trust Issue on Vista

Getting Microsoft.VisualStudio.TestTools.TestManagement.ExecutionException: Test Run deployment issue: on Vista and how to solve it

Tuesday, January 22, 2008 11:34 PM by Infosys | Microsoft

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Yes this is an old post but brought up when trying to find something out about ADS.

It seems that Microsoft itself will strip all the ADS from a file when it is "sent to a compressed folder."

When the file is extracted the ADS is no longer present.

Monday, April 14, 2008 2:53 PM by txsquarebear

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

here is a recursive version

var shell=new ActiveXObject("WScript.Shell");

fso=new ActiveXObject("Scripting.FileSystemObject");

var total=0;

var rf=fso.GetFolder('.');              // Current folder

loop(rf, fso.GetAbsolutePathName('.'))

function loop(f, path)

{

   var fe = new Enumerator(f.SubFolders);

   for (; !fe.atEnd(); fe.moveNext())

   {

       loop(fe.item(), fso.BuildPath(path, fe.item().Name));

   }

   var fc=new Enumerator(f.files);

   for (; !fc.atEnd(); fc.moveNext())

   {

       var fileName=fc.item().Name+':Zone.Identifier';

       try

       {

           f1 = fso.OpenTextFile(path + "\\" + fileName,2); // If the Zone Identifier does not exist ..

           total++;

           f1.Close();

       }

       catch(e){}                           // .. we don't care

   }

}

shell.Popup('Unblocked '+total+' files');

Thursday, May 08, 2008 3:45 PM by binyomin

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

As per usual, the hackers will find a way to exploit this whilst causing legitimate users a comprehensive pain in the neck and thousands of dollars in tech support costs trying to track down a fix posted on some obscure BBS somewhere in cyberspace. Stop doing half the bloody job MS. Fix up the errors displayed when accessing the files so we have some clue as to why it's happening, and give us another accessory off the start menu to recursively change the attributes !!!

Bollocks !!!!!

Friday, June 20, 2008 12:00 AM by rickfreezerburn

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Hi Rick.

Sorry to hear that this has caused you pain. I'll forward on your feedback to the right folks.

Glenn

Friday, June 20, 2008 12:09 AM by Glenn Block

# re: Tips: Streams, Zones, Vista and Blocked Files in IE

Rick, you know you can right click on a zip BEFORE you extract and from the properties dialog you can unblock all the files in one shot.

Friday, June 20, 2008 12:14 AM by Glenn Block

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker