Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XP - Blocked file
Message
De
15/11/2008 05:02:30
 
 
À
14/11/2008 13:26:26
Information générale
Forum:
Windows
Catégorie:
Sécurité
Divers
Thread ID:
01361699
Message ID:
01362060
Vues:
9
>>>>Hi,
>>>>
>>>>When I receive an XML attachment via Email and save it to a file the file is 'blocked'.
>>>>If, for example, I open it in IE then I see the nested XML tags but cannot expand/collapse the nodes.
>>>>If I look at the properties of the file in question at the bottom of the 'General' page it states:
>>>>"This file came from another computer and might be blocked to help protect this computer"
>>>>
>>>>Question: How to "Unblock" such a file programatically ?
>>>>
>>>>TIA
>>>>Viv
>>>___
>>>Viv,
>>>
>>>Some pointers - I haven't tested any of them, nor have I figured it out
>>>
>>>But the Zip/delete/Unzip [ I have tested it with success ] is imo the simplest means - especially since it's only an xml file
>>>
>>>As I see it, it's the Zone.Identifier info in the 'alternate data streams' of the file (http://blogs.msdn.com/powershell/archive/2007/03/07/how-does-the-remotesigned-execution-policy-work.aspx)
>>>
>>>Look at the xml and below -
>>>http://thepowershellguy.com/blogs/posh/archive/2007/01/27/powershell-accessing-alternative-data-streams-of-files-on-an-ntfs-volume.aspx
>>>
>>>
>>>
>>>[ http://support.microsoft.com/kb/883260/
>>>http://msdn.microsoft.com/en-us/library/system.management.automation.verbssecurity.unblock(VS.85).aspx
>>>]
>>>
>>>http://weblogs.asp.net/kennykerr/archive/2008/09/12/visual-c-in-short-unblock-downloaded-applications.aspx
>>>
>>>This one is funny: http://blogs.msdn.com/toddha/archive/2008/06/26/faster-way-to-unblock-files-in-explorer.aspx
>>>Zip the files, delete them and unzip them again
>>>
>>>
>>>This is the streams Sergey is talking about : http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx
>>>
>>>I think it must be possible with the power shell
>>
>>Hi,
>>
>>Thanks for the links - better than the ones I found.
>>Haven't read them all yet but the first link seems to suggest a simple solution:
>> If running [notepad “FileName:Zone.Identifier"] allows you to change and save the ZoneId setting then maybe I can just do the same thing by opening it in .NET ?
>>
>>I'll try it in the morning........
>>Best,
>>Viv
>----
>
>Viv,
>
>The links are not easy to find - found a couple of them yesterday - let it rest and had a hell of a time finding them back today
>
>It's more of a collection of links - no structure - but then
>
>I'm not sure about the notepad
>
>I think it may be possible - I gave up yesterday. My impression - may be wrong - is that once you have the powershell dll/assembly you can do it as long as you have the appropriate permissons to the file
>
>It seems to me that you have to take the Zone.Identifier out of the alternate data stream. I also found a message from someone complaining that .net provides no access to the alternate data stream. [ think it was by design ....]
>
>I left it there - but I may, just may be tempted to have a look at it tomorrow. I love a good brain-teaser
>
>Success,

Hi,

I certainly can't open the stream in .Net as simply as with Notepad !
Something like:
StreamReader file = new StreamReader("D:\\Tmp\\Alternate.XML:Zone.Identifier");
gives exception:
"The given path's format is not supported."

There's a solution here with source code:http://www.codeproject.com/KB/cs/ntfsstreams.aspx
Haven't looked at it closely but it's not trivial......
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform