Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

Alternate Data Streams on files

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 01-09-2007   #1 (permalink)
Brandon Shell
Guest


 

Alternate Data Streams on files

Anyone have and idea if its possible and how to do this in Powershell?

--

Brandon Shell
---------------
Stop by my blog some time
http://mybsinfo.blogspot.com/
----------------------------------


My System SpecsSystem Spec
Old 01-09-2007   #2 (permalink)
Gaurhoth
Guest


 

Re: Alternate Data Streams on files

..NET doesn't seem to have any managed support for accessing ADS so I would expect that Powershell lacks support as well. There are win32 api's that allow access... but you'd likely need a third party dll to use that from Powershell.

You could creatively use some command line commands that support ADS to *read* the contents of a stream. I'm sure variations of this could be adapted for writing... but nothing in native powershell.

PS C:\Downloads> cmd /c "dir /r"
Volume in drive C has no label.
Volume Serial Number is 0000-0000

Directory of C:\Downloads

01/08/2007 11:09 PM <DIR> .
01/08/2007 11:09 PM <DIR> ..
12/22/2006 11:08 PM 23,510,720 dotnetfx_v2.0.exe
26 dotnetfx_v2.0.exe:Zone.Identifier:$DATA

PS C:\Downloads> $r = cmd /c "more < dotnetfx_v2.0.exe:Zone.Identifier:$DATA"
PS C:\Downloads> $r
[ZoneTransfer]
ZoneId=3

--

gaurhoth
http://gaurhothw.spaces.live.com/


"Brandon Shell" <tshell.mask@gmail.com> wrote in message news:ekkPVaCNHHA.1248@TK2MSFTNGP03.phx.gbl...
> Anyone have and idea if its possible and how to do this in Powershell?
>
> --
>
> Brandon Shell
> ---------------
> Stop by my blog some time
> http://mybsinfo.blogspot.com/
> ----------------------------------
>

My System SpecsSystem Spec
Old 01-09-2007   #3 (permalink)
Maximilian Hänel
Guest


 

Re: Alternate Data Streams on files

Hi Brandon

> Anyone have and idea if its possible and how to do this in Powershell?


A few month ago dreeschkind posted this one:

http://groups.google.de/group/micros...697a0aba7ab9ec

hth

Max
My System SpecsSystem Spec
Old 01-09-2007   #4 (permalink)
Brandon Shell
Guest


 

Re: Alternate Data Streams on files

Thanks... That was what I was looking for... I knew it had been discussed,
but my searches as well as google let me down

"Maximilian Hänel" <ngSpam@smjh.de> wrote in message
news:eXX$5tDNHHA.4376@TK2MSFTNGP03.phx.gbl...
> Hi Brandon
>
>> Anyone have and idea if its possible and how to do this in Powershell?

>
> A few month ago dreeschkind posted this one:
>
> http://groups.google.de/group/micros...697a0aba7ab9ec
>
> hth
>
> Max


My System SpecsSystem Spec
Old 01-10-2007   #5 (permalink)
/\\/\\o\\/\\/ [MVP]
Guest


 

Re: Alternate Data Streams on files

I'm using the library i mentioned in the former thread,

[void][System.Reflection.Assembly]::LoadFile("c:\powershell\ntfs.dll")

and I have the following in my typedata, I use for unblocking files, I still
have this on my "to blog" list

<Type>
<Name>System.IO.FileSystemInfo</Name>
<Members>
<ScriptMethod>
<Name>Block</Name>
<Script>
$FS = new NTFS.FileStreams($this.fullname)
$fs.add('Zone.Identifier')
$stream = $fs.Item('Zone.Identifier').open()

$sw = [System.IO.streamwriter]$stream
$Sw.writeline('[ZoneTransfer]')
$sw.writeline('ZoneID=4')
$sw.close()

$stream.close()
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>UnBlock</Name>
<Script>
$FS = new NTFS.FileStreams($this.fullname)
$fs['Zone.Identifier'].delete()
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>GetFileStreams</Name>
<Script>
$FS = new NTFS.FileStreams($this.fullname)
$fs
</Script>
</ScriptMethod>

Greetings /\/\o\/\/

"Brandon Shell" <tshell@mask.gmail.com> wrote in message
news:OeWlGHENHHA.1240@TK2MSFTNGP03.phx.gbl...
> Thanks... That was what I was looking for... I knew it had been discussed,
> but my searches as well as google let me down
>
> "Maximilian Hänel" <ngSpam@smjh.de> wrote in message
> news:eXX$5tDNHHA.4376@TK2MSFTNGP03.phx.gbl...
>> Hi Brandon
>>
>>> Anyone have and idea if its possible and how to do this in Powershell?

>>
>> A few month ago dreeschkind posted this one:
>>
>> http://groups.google.de/group/micros...697a0aba7ab9ec
>>
>> hth
>>
>> Max

>


My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bitmaps from streams - duplicated data in memory? Chris Ashley .NET General 1 06-20-2008 01:35 PM
any way to enable "alternate data streams" in Vista ? Max Vista file management 3 03-18-2008 03:04 PM
Is it possible to use NTFS alternate data streams? joe Live Folder Share 1 12-14-2007 03:49 PM
No files or data on IE 7 temporary Internet Files on standard acco GT Vista General 3 02-27-2007 04:57 PM


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51