Home All Groups Group Topic Archive Search About

Can we use Shell to write file properties

Author
19 Aug 2010 2:22 PM
GS
Just to follow through on a previous post "How to get the File
Properties", is there a way to write these properties using Shell?

I'm looking for a way to do this without having to use an external
component such as DsoFile.dll or dwProp.dll. Any suggestions are
appreciated!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc

Author
19 Aug 2010 4:11 PM
ralph
On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:

>Just to follow through on a previous post "How to get the File
>Properties", is there a way to write these properties using Shell?
>
>I'm looking for a way to do this without having to use an external
>component such as DsoFile.dll or dwProp.dll. Any suggestions are
>appreciated!

For general properties such as date and attributes take a look at
SetFileTime and SetFileAttributes.

But I think you are after the extend properties (alternate data
streams). Is that correct? If so then you are better off using dso or
dwProp. I've never seen a reliable way of doing it in VB, not to say
one doesn't exist. (After all you can do some writing with a batch
file.) Also consider that these data streams are slightly different on
different O/Ss so using these components will make your app more
portable.

If it is for a production or shrinkwrap app, use the components - your
life will be easier. If you have an overwhelming need to not use them,
or you just want to play with the idea - then stay tuned, I'm sure
someone will be along with a robust method to make a liar out of me.
<g>

-ralph
Author
19 Aug 2010 4:40 PM
GS
on 8/19/2010, ralph supposed :
Show quoteHide quote
> On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:
>
>> Just to follow through on a previous post "How to get the File
>> Properties", is there a way to write these properties using Shell?
>>
>> I'm looking for a way to do this without having to use an external
>> component such as DsoFile.dll or dwProp.dll. Any suggestions are
>> appreciated!
>
> For general properties such as date and attributes take a look at
> SetFileTime and SetFileAttributes.
>
> But I think you are after the extend properties (alternate data
> streams). Is that correct? If so then you are better off using dso or
> dwProp. I've never seen a reliable way of doing it in VB, not to say
> one doesn't exist. (After all you can do some writing with a batch
> file.) Also consider that these data streams are slightly different on
> different O/Ss so using these components will make your app more
> portable.
>
> If it is for a production or shrinkwrap app, use the components - your
> life will be easier. If you have an overwhelming need to not use them,
> or you just want to play with the idea - then stay tuned, I'm sure
> someone will be along with a robust method to make a liar out of me.
> <g>
>
> -ralph

Thanks ralph!
You are correct in your assertion about extended properties.
Specifically, I'm after a means to read/write NTFS SummaryProperties,
which is what dsofile/dwprop do. Since they both use WinAPI for this I
was curious if anyone has a VB version.

I already use both COMs as dsofile won't write Title in all cases if
the other props are blank, so dwprop does this unconditionally. Also,
dwprop doesn't treat Category as a SummaryProperty and so I have to use
dsofile to write that.

I would be nice to have a single solution so I don't have to use/ship
both components. I actually do not need to read these props so much as
be able to write them when a user's FS is NTFS.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
19 Aug 2010 6:57 PM
ralph
On Thu, 19 Aug 2010 12:40:54 -0400, GS <gesan***@netscape.net> wrote:

>You are correct in your assertion about extended properties.
>Specifically, I'm after a means to read/write NTFS SummaryProperties,
>which is what dsofile/dwprop do. Since they both use WinAPI for this I
>was curious if anyone has a VB version.
>
>I already use both COMs as dsofile won't write Title in all cases if
>the other props are blank, so dwprop does this unconditionally. Also,
>dwprop doesn't treat Category as a SummaryProperty and so I have to use
>dsofile to write that.
>
>I would be nice to have a single solution so I don't have to use/ship
>both components. I actually do not need to read these props so much as
>be able to write them when a user's FS is NTFS.

Yep it sure would be handy.

If your product is to be used with any Office product, dsoFile is
probably already there.

I probably should expand on why I said most roll-ur-own solutions work
poorly, it is because the extended properties are stored as binary, so
you have to encode going in and decode coming out. This makes creating
your own OSFA "dsoFile.dll" a bit of a pain - BUT since you have very
limited objectives you may have better success.

-ralph
Author
19 Aug 2010 7:53 PM
GS
ralph used his keyboard to write :
Show quoteHide quote
> On Thu, 19 Aug 2010 12:40:54 -0400, GS <gesan***@netscape.net> wrote:
>
>> You are correct in your assertion about extended properties.
>> Specifically, I'm after a means to read/write NTFS SummaryProperties,
>> which is what dsofile/dwprop do. Since they both use WinAPI for this I
>> was curious if anyone has a VB version.
>>
>> I already use both COMs as dsofile won't write Title in all cases if
>> the other props are blank, so dwprop does this unconditionally. Also,
>> dwprop doesn't treat Category as a SummaryProperty and so I have to use
>> dsofile to write that.
>>
>> I would be nice to have a single solution so I don't have to use/ship
>> both components. I actually do not need to read these props so much as
>> be able to write them when a user's FS is NTFS.
>
> Yep it sure would be handy.
>
> If your product is to be used with any Office product, dsoFile is
> probably already there.

So far, I have always needed to ship dsofile for the Excel addin
version of my app, so I don't think it ships with M$O. In fact, AFAIK
Microsoft doesn't support this DLL even though there's an entire
website/forum for it.<??>

>
> I probably should expand on why I said most roll-ur-own solutions work
> poorly, it is because the extended properties are stored as binary, so
> you have to encode going in and decode coming out. This makes creating
> your own OSFA "dsoFile.dll" a bit of a pain - BUT since you have very
> limited objectives you may have better success.

In my case I'd only have to write if the FS is NTFS. My apps don't read
the SummaryProperties and so I guess it would just be a one-way deal.

The only purpose for using these file props is for the convenience of
users being able to view them in Windows Explorer on pre-Win6 OSs.
Otherwise, I've been providing a VBExplorer version (based on Brad
Marinez's sample project) replacement for WE with my XL addin that
displays these in its listview. The VB6.exe doesn't need this because
it uses a 3rd party explorer tv/lv control set that I can program to
the nines. These apps are for managing cnc program files (plain text)
and the props are embedded in the file contents, but I also write them
to the file properties if they're stored on NTFS volumes so they can be
viewed without a special explorer. (Both the VBExplorer and the VB6.exe
read this info directly from the file contents so they work on any
storage media)

AFAIK, these can't be viewed in WE on Win6> OSs because WE doesn't
display the columns like it does in earlier Win vers.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
23 Aug 2010 4:05 PM
GS
It appears that XP is the last NTFS OS that supports the
SummaryInformation data that could be viewed on the 'Summary' tab of a
file's Properties dialog.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
23 Aug 2010 8:21 PM
ralph
On Mon, 23 Aug 2010 12:05:23 -0400, GS <gesan***@netscape.net> wrote:

>It appears that XP is the last NTFS OS that supports the
>SummaryInformation data that could be viewed on the 'Summary' tab of a
>file's Properties dialog.

Doesn't surprise me.

ADS and 'Versioning' have always been mucky subjects, with the main
issue being no one clear or consistent method.

Explorer itself works its magic by using various 'addons' or services
- most of which can be employed by developers for their own uses, but
are poorly documented and just as poorly tailored for "universal" use.
(In some cases looking like ad hoc hacks.)

You will also run into the problem that fewer VBers went there,
finding that simply using the utilities provided for specific products
works 'well enough' most of the time. If you really want to get into
all the ins and outs of ADS/Versioning you need to brush off your VC++
and system skills and get ready to do a ton of online mining. But
worse, also be prepared for it to break with the next release. <bg>

-ralph
Author
23 Aug 2010 8:46 PM
Kevin Provance
Show quote Hide quote
"ralph" <nt_consultin***@yahoo.net> wrote in message
news:bek57696qi0et8v11rmpgi3navhqhlrli8@4ax.com...
:
: Doesn't surprise me.
:
: ADS and 'Versioning' have always been mucky subjects, with the main
: issue being no one clear or consistent method.
:
: Explorer itself works its magic by using various 'addons' or services
: - most of which can be employed by developers for their own uses, but
: are poorly documented and just as poorly tailored for "universal" use.
: (In some cases looking like ad hoc hacks.)
:
: You will also run into the problem that fewer VBers went there,
: finding that simply using the utilities provided for specific products
: works 'well enough' most of the time. If you really want to get into
: all the ins and outs of ADS/Versioning you need to brush off your VC++
: and system skills and get ready to do a ton of online mining. But
: worse, also be prepared for it to break with the next release. <bg>

I think I read someplace Windows added ADS for compatibility with Mac file
formatting when used in conjunction with portable drives and media.
Author
23 Aug 2010 9:12 PM
Tom Shelton
ralph pretended :
Show quoteHide quote
> On Mon, 23 Aug 2010 12:05:23 -0400, GS <gesan***@netscape.net> wrote:
>
>> It appears that XP is the last NTFS OS that supports the
>> SummaryInformation data that could be viewed on the 'Summary' tab of a
>> file's Properties dialog.
>
> Doesn't surprise me.
>
> ADS and 'Versioning' have always been mucky subjects, with the main
> issue being no one clear or consistent method.
>
> Explorer itself works its magic by using various 'addons' or services
> - most of which can be employed by developers for their own uses, but
> are poorly documented and just as poorly tailored for "universal" use.
> (In some cases looking like ad hoc hacks.)
>
> You will also run into the problem that fewer VBers went there,
> finding that simply using the utilities provided for specific products
> works 'well enough' most of the time. If you really want to get into
> all the ins and outs of ADS/Versioning you need to brush off your VC++
> and system skills and get ready to do a ton of online mining. But
> worse, also be prepared for it to break with the next release. <bg>
>
> -ralph

I'm not sure what you think is so hard about it?  ADS, in and of it
self is simply a specially named file.  If you are reading and writing
custom information to ADS, then there is nothing at all difficult...

The problems come in when dealing with other peoples streams - such as
those used to store the summary file infromation :)

--
Tom Shelton
Author
23 Aug 2010 9:48 PM
ralph
On Mon, 23 Aug 2010 15:12:52 -0600, Tom Shelton
<tom_shelton@comcast.invalid> wrote:

Show quoteHide quote
>ralph pretended :
>> On Mon, 23 Aug 2010 12:05:23 -0400, GS <gesan***@netscape.net> wrote:
>>
>>> It appears that XP is the last NTFS OS that supports the
>>> SummaryInformation data that could be viewed on the 'Summary' tab of a
>>> file's Properties dialog.
>>
>> Doesn't surprise me.
>>
>> ADS and 'Versioning' have always been mucky subjects, with the main
>> issue being no one clear or consistent method.
>>
>> Explorer itself works its magic by using various 'addons' or services
>> - most of which can be employed by developers for their own uses, but
>> are poorly documented and just as poorly tailored for "universal" use.
>> (In some cases looking like ad hoc hacks.)
>>
>> You will also run into the problem that fewer VBers went there,
>> finding that simply using the utilities provided for specific products
>> works 'well enough' most of the time. If you really want to get into
>> all the ins and outs of ADS/Versioning you need to brush off your VC++
>> and system skills and get ready to do a ton of online mining. But
>> worse, also be prepared for it to break with the next release. <bg>
>>
>> -ralph
>
>I'm not sure what you think is so hard about it?  ADS, in and of it
>self is simply a specially named file.  If you are reading and writing
>custom information to ADS, then there is nothing at all difficult...
>
>The problems come in when dealing with other peoples streams - such as
>those used to store the summary file infromation :)

Tah Dah! Now you got it.

-ralph
<g>
Author
23 Aug 2010 9:51 PM
GS
Tom Shelton wrote on 8/23/2010 :
Show quoteHide quote
> ralph pretended :
>> On Mon, 23 Aug 2010 12:05:23 -0400, GS <gesan***@netscape.net> wrote:
>>
>>> It appears that XP is the last NTFS OS that supports the
>>> SummaryInformation data that could be viewed on the 'Summary' tab of a
>>> file's Properties dialog.
>>
>> Doesn't surprise me.
>>
>> ADS and 'Versioning' have always been mucky subjects, with the main
>> issue being no one clear or consistent method.
>>
>> Explorer itself works its magic by using various 'addons' or services
>> - most of which can be employed by developers for their own uses, but
>> are poorly documented and just as poorly tailored for "universal" use.
>> (In some cases looking like ad hoc hacks.)
>>
>> You will also run into the problem that fewer VBers went there,
>> finding that simply using the utilities provided for specific products
>> works 'well enough' most of the time. If you really want to get into
>> all the ins and outs of ADS/Versioning you need to brush off your VC++
>> and system skills and get ready to do a ton of online mining. But
>> worse, also be prepared for it to break with the next release. <bg>
>>
>> -ralph
>
> I'm not sure what you think is so hard about it?  ADS, in and of it self is
> simply a specially named file.  If you are reading and writing custom
> information to ADS, then there is nothing at all difficult...
>
> The problems come in when dealing with other peoples streams - such as those
> used to store the summary file infromation :)

Sadly, it's the SummaryInformation data that my app uses. I'll continue
to write these properties with dwProp.dll and DsoFile.dll for awhile
yet since many users still have XP machines. I added special treatment
of this for NTFS volumes on OS6 or higher so they don't get written and
the error notification doesn't display. (I use a custom error handler
that graciously notifies users if writing properties generates any
errors)

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
19 Aug 2010 8:13 PM
Tom Shelton
On Aug 19, 10:11 am, ralph <nt_consultin***@yahoo.net> wrote:
Show quoteHide quote
> On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:
> >Just to follow through on a previous post "How to get the File
> >Properties", is there a way to write these properties using Shell?
>
> >I'm looking for a way to do this without having to use an external
> >component such as DsoFile.dll or dwProp.dll. Any suggestions are
> >appreciated!
>
> For general properties such as date and attributes take a look at
> SetFileTime and SetFileAttributes.
>
> But I think you are after the extend properties (alternate data
> streams). Is that correct? If so then you are better off using dso or
> dwProp. I've never seen a reliable way of doing it in VB, not to say
> one doesn't exist. (After all you can do some writing with a batch
> file.) Also consider that these data streams are slightly different on
> different O/Ss so using these components will make your app more
> portable.
>
> If it is for a production or shrinkwrap app, use the components - your
> life will be easier. If you have an overwhelming need to not use them,
> or you just want to play with the idea - then stay tuned, I'm sure
> someone will be along with a robust method to make a liar out of me.
> <g>
>
> -ralph

Well...  If your talking about ADS (alternative data streams), you can
manage them via the Win32 api....

Enumerating ADS:  Look at BackupRead and BackupSeek (on Vista and
above you can use FindFirstFirstStreamW and FindNextStreamW)

To actually read/write/create them you will probably have to resort to
CreateFile, ReadFile, and WriteFile.

--
Tom Shelton
Author
19 Aug 2010 8:19 PM
Tom Shelton
On Aug 19, 10:11 am, ralph <nt_consultin***@yahoo.net> wrote:
Show quoteHide quote
> On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:
> >Just to follow through on a previous post "How to get the File
> >Properties", is there a way to write these properties using Shell?
>
> >I'm looking for a way to do this without having to use an external
> >component such as DsoFile.dll or dwProp.dll. Any suggestions are
> >appreciated!
>
> For general properties such as date and attributes take a look at
> SetFileTime and SetFileAttributes.
>
> But I think you are after the extend properties (alternate data
> streams). Is that correct? If so then you are better off using dso or
> dwProp. I've never seen a reliable way of doing it in VB, not to say
> one doesn't exist. (After all you can do some writing with a batch
> file.) Also consider that these data streams are slightly different on
> different O/Ss so using these components will make your app more
> portable.
>
> If it is for a production or shrinkwrap app, use the components - your
> life will be easier. If you have an overwhelming need to not use them,
> or you just want to play with the idea - then stay tuned, I'm sure
> someone will be along with a robust method to make a liar out of me.
> <g>
>
> -ralph

Oh... and one other thing :)  When you use CreateFile/ReadFile/
WriteFile/OpenFile etc....  The path to the stream is path-to-main-
file:mystreamname.

So, for instance if I have a text file dumb.txt and I want to add an
idiot.txt as a ADS, the name of the stream would be
dumb.txt:idiot.txt.   I hope that makes sense?

--
Tom Shelton
Author
19 Aug 2010 10:33 PM
GS
Tom Shelton was thinking very hard :
Show quoteHide quote
> On Aug 19, 10:11 am, ralph <nt_consultin***@yahoo.net> wrote:
>> On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:
>>> Just to follow through on a previous post "How to get the File
>>> Properties", is there a way to write these properties using Shell?
>>> I'm looking for a way to do this without having to use an external
>>> component such as DsoFile.dll or dwProp.dll. Any suggestions are
>>> appreciated!
>>
>> For general properties such as date and attributes take a look at
>> SetFileTime and SetFileAttributes.
>>
>> But I think you are after the extend properties (alternate data
>> streams). Is that correct? If so then you are better off using dso or
>> dwProp. I've never seen a reliable way of doing it in VB, not to say
>> one doesn't exist. (After all you can do some writing with a batch
>> file.) Also consider that these data streams are slightly different on
>> different O/Ss so using these components will make your app more
>> portable.
>>
>> If it is for a production or shrinkwrap app, use the components - your
>> life will be easier. If you have an overwhelming need to not use them,
>> or you just want to play with the idea - then stay tuned, I'm sure
>> someone will be along with a robust method to make a liar out of me.
>> <g>
>>
>> -ralph
>
> Oh... and one other thing :)  When you use CreateFile/ReadFile/
> WriteFile/OpenFile etc....  The path to the stream is path-to-main-
> file:mystreamname.
>
> So, for instance if I have a text file dumb.txt and I want to add an
> idiot.txt as a ADS, the name of the stream would be
> dumb.txt:idiot.txt.   I hope that makes sense?

Ok Tom, thanks for the input. I understand this ADS concept from prior
readings on streams and related material. These are not what I want
because earlier than Win6 vers's WE can't display this info via the
optional columns available. Thus, I need to stick with the
SummaryProperties because the embedded value pairs are named
accordingly (ie: Title=,Author=,Subject=,Category=,Keyword=,Comment=)
and so I want to maintain consistency.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
19 Aug 2010 10:47 PM
Tom Shelton
GS pretended :
Show quoteHide quote
> Tom Shelton was thinking very hard :
>> On Aug 19, 10:11 am, ralph <nt_consultin***@yahoo.net> wrote:
>>> On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:
>>>> Just to follow through on a previous post "How to get the File
>>>> Properties", is there a way to write these properties using Shell?
>>>> I'm looking for a way to do this without having to use an external
>>>> component such as DsoFile.dll or dwProp.dll. Any suggestions are
>>>> appreciated!
>>>
>>> For general properties such as date and attributes take a look at
>>> SetFileTime and SetFileAttributes.
>>>
>>> But I think you are after the extend properties (alternate data
>>> streams). Is that correct? If so then you are better off using dso or
>>> dwProp. I've never seen a reliable way of doing it in VB, not to say
>>> one doesn't exist. (After all you can do some writing with a batch
>>> file.) Also consider that these data streams are slightly different on
>>> different O/Ss so using these components will make your app more
>>> portable.
>>>
>>> If it is for a production or shrinkwrap app, use the components - your
>>> life will be easier. If you have an overwhelming need to not use them,
>>> or you just want to play with the idea - then stay tuned, I'm sure
>>> someone will be along with a robust method to make a liar out of me.
>>> <g>
>>>
>>> -ralph
>>
>> Oh... and one other thing :)  When you use CreateFile/ReadFile/
>> WriteFile/OpenFile etc....  The path to the stream is path-to-main-
>> file:mystreamname.
>>
>> So, for instance if I have a text file dumb.txt and I want to add an
>> idiot.txt as a ADS, the name of the stream would be
>> dumb.txt:idiot.txt.   I hope that makes sense?
>
> Ok Tom, thanks for the input. I understand this ADS concept from prior
> readings on streams and related material. These are not what I want because
> earlier than Win6 vers's WE can't display this info via the optional columns
> available. Thus, I need to stick with the SummaryProperties because the
> embedded value pairs are named accordingly (ie:
> Title=,Author=,Subject=,Category=,Keyword=,Comment=) and so I want to
> maintain consistency.

Ok...  So what your really after is the information in the summary
tab...  Got it.

That is implemented via a COM interface IPropertySetStorage - you can
get a hold of this via the StgOpenStorageEx function.  I would have to
play with it a bit though - as I haven't actually tried to manipulate
the standard stream.  I'll play around a bit more and see if I can make
this work.

--
Tom Shelton
Author
19 Aug 2010 11:22 PM
Tom Shelton
After serious thinking Tom Shelton wrote :
Show quoteHide quote
> GS pretended :
>> Tom Shelton was thinking very hard :
>>> On Aug 19, 10:11 am, ralph <nt_consultin***@yahoo.net> wrote:
>>>> On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:
>>>>> Just to follow through on a previous post "How to get the File
>>>>> Properties", is there a way to write these properties using Shell?
>>>>> I'm looking for a way to do this without having to use an external
>>>>> component such as DsoFile.dll or dwProp.dll. Any suggestions are
>>>>> appreciated!
>>>>
>>>> For general properties such as date and attributes take a look at
>>>> SetFileTime and SetFileAttributes.
>>>>
>>>> But I think you are after the extend properties (alternate data
>>>> streams). Is that correct? If so then you are better off using dso or
>>>> dwProp. I've never seen a reliable way of doing it in VB, not to say
>>>> one doesn't exist. (After all you can do some writing with a batch
>>>> file.) Also consider that these data streams are slightly different on
>>>> different O/Ss so using these components will make your app more
>>>> portable.
>>>>
>>>> If it is for a production or shrinkwrap app, use the components - your
>>>> life will be easier. If you have an overwhelming need to not use them,
>>>> or you just want to play with the idea - then stay tuned, I'm sure
>>>> someone will be along with a robust method to make a liar out of me.
>>>> <g>
>>>>
>>>> -ralph
>>>
>>> Oh... and one other thing :)  When you use CreateFile/ReadFile/
>>> WriteFile/OpenFile etc....  The path to the stream is path-to-main-
>>> file:mystreamname.
>>>
>>> So, for instance if I have a text file dumb.txt and I want to add an
>>> idiot.txt as a ADS, the name of the stream would be
>>> dumb.txt:idiot.txt.   I hope that makes sense?
>>
>> Ok Tom, thanks for the input. I understand this ADS concept from prior
>> readings on streams and related material. These are not what I want because
>> earlier than Win6 vers's WE can't display this info via the optional
>> columns available. Thus, I need to stick with the SummaryProperties because
>> the embedded value pairs are named accordingly (ie:
>> Title=,Author=,Subject=,Category=,Keyword=,Comment=) and so I want to
>> maintain consistency.
>
> Ok...  So what your really after is the information in the summary tab... 
> Got it.
>
> That is implemented via a COM interface IPropertySetStorage - you can get a
> hold of this via the StgOpenStorageEx function.  I would have to play with it
> a bit though - as I haven't actually tried to manipulate the standard stream.
>  I'll play around a bit more and see if I can make this work.

Well...   It looks like using IPropertySetStorage and IPropertyStorage
are actually problematic in VB6.  They are not dual interfaces - in
other words they don't implement IDispatch.  So, to use them you would
have to write a VB friendly typelib or find one...  And then use them
in conjuction with the various StgOpenStorageEx functions.

AFICT, that would be the only universal solution to the problem.

Interesting problem...  I might have to see if I can dust off my old
typelib generating skills (assuming I can't find one) and give it a
whirl :)

--
Tom Shelton
Author
20 Aug 2010 2:32 PM
Tom Shelton
On Aug 19, 5:22 pm, Tom Shelton <tom_shel...@comcast.invalid> wrote:
Show quoteHide quote
> After serious thinking Tom Shelton wrote :
>
>
>
> > GS pretended :
> >> Tom Shelton was thinking very hard :
> >>> On Aug 19, 10:11 am, ralph <nt_consultin***@yahoo.net> wrote:
> >>>> On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:
> >>>>> Just to follow through on a previous post "How to get the File
> >>>>> Properties", is there a way to write these properties using Shell?
> >>>>> I'm looking for a way to do this without having to use an external
> >>>>> component such as DsoFile.dll or dwProp.dll. Any suggestions are
> >>>>> appreciated!
>
> >>>> For general properties such as date and attributes take a look at
> >>>> SetFileTime and SetFileAttributes.
>
> >>>> But I think you are after the extend properties (alternate data
> >>>> streams). Is that correct? If so then you are better off using dso or
> >>>> dwProp. I've never seen a reliable way of doing it in VB, not to say
> >>>> one doesn't exist. (After all you can do some writing with a batch
> >>>> file.) Also consider that these data streams are slightly different on
> >>>> different O/Ss so using these components will make your app more
> >>>> portable.
>
> >>>> If it is for a production or shrinkwrap app, use the components - your
> >>>> life will be easier. If you have an overwhelming need to not use them,
> >>>> or you just want to play with the idea - then stay tuned, I'm sure
> >>>> someone will be along with a robust method to make a liar out of me.
> >>>> <g>
>
> >>>> -ralph
>
> >>> Oh... and one other thing :)  When you use CreateFile/ReadFile/
> >>> WriteFile/OpenFile etc....  The path to the stream is path-to-main-
> >>> file:mystreamname.
>
> >>> So, for instance if I have a text file dumb.txt and I want to add an
> >>> idiot.txt as a ADS, the name of the stream would be
> >>> dumb.txt:idiot.txt.   I hope that makes sense?
>
> >> Ok Tom, thanks for the input. I understand this ADS concept from prior
> >> readings on streams and related material. These are not what I want because
> >> earlier than Win6 vers's WE can't display this info via the optional
> >> columns available. Thus, I need to stick with the SummaryProperties because
> >> the embedded value pairs are named accordingly (ie:
> >> Title=,Author=,Subject=,Category=,Keyword=,Comment=) and so I want to
> >> maintain consistency.
>
> > Ok...  So what your really after is the information in the summary tab...  
> > Got it.
>
> > That is implemented via a COM interface IPropertySetStorage - you can get a
> > hold of this via the StgOpenStorageEx function.  I would have to play with it
> > a bit though - as I haven't actually tried to manipulate the standard stream.
> >  I'll play around a bit more and see if I can make this work.
>
> Well...   It looks like using IPropertySetStorage and IPropertyStorage
> are actually problematic in VB6.  They are not dual interfaces - in
> other words they don't implement IDispatch.  So, to use them you would
> have to write a VB friendly typelib or find one...  And then use them
> in conjuction with the various StgOpenStorageEx functions.
>
> AFICT, that would be the only universal solution to the problem.
>
> Interesting problem...  I might have to see if I can dust off my old
> typelib generating skills (assuming I can't find one) and give it a
> whirl :)
>
> --
> Tom Shelton

Well, it looks like Edanmo already solved this problem.

http://www.mvps.org/emorcillo/en/code/vb6/index.shtml

On that page you will find the necessary typelib and a sample of usage
- "Using Structured Storage Files".   I have not run the sample, but I
did browse the code and he is using the StgXXXStorageEx functions and
there is a class that gets the properties (Author, Comments, etc), so
it does appear to be partly what you want anyway...

--
Tom Shelton
Author
20 Aug 2010 6:36 PM
GS
> Well, it looks like Edanmo already solved this problem.
>
> http://www.mvps.org/emorcillo/en/code/vb6/index.shtml
>
> On that page you will find the necessary typelib and a sample of usage
> - "Using Structured Storage Files".   I have not run the sample, but I
> did browse the code and he is using the StgXXXStorageEx functions and
> there is a class that gets the properties (Author, Comments, etc), so
> it does appear to be partly what you want anyway...

Thanks Tom!
This looks very interesting as it appears I'd only have to dist 1 lib.
I'll play around with it and let you know how it goes...

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
20 Aug 2010 9:07 PM
GS
Bummer! It doesn't work 'as is'. (Won't write Summary props) It fails
somewhere in the 'required' olelib.tlb.<$%&&*>

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
21 Aug 2010 12:02 AM
Tom Shelton
GS laid this down on his screen :
> Bummer! It doesn't work 'as is'. (Won't write Summary props) It fails
> somewhere in the 'required' olelib.tlb.<$%&&*>

Hmmm... Did you grab olelib.tlb?  I think that's the first thing on the
link.  And you won't have to actually distribute the typelib, just
reference it an compile.

Though, there could be something wrong - like I said, I didn't actually
run the sample :)  I see if I can take a look at it latter.

--
Tom Shelton
Author
21 Aug 2010 2:46 AM
GS
Tom Shelton explained :
> GS laid this down on his screen :
>> Bummer! It doesn't work 'as is'. (Won't write Summary props) It fails
>> somewhere in the 'required' olelib.tlb.<$%&&*>
>
> Hmmm... Did you grab olelib.tlb?  I think that's the first thing on the link.
>  And you won't have to actually distribute the typelib, just reference it an
> compile.
>
> Though, there could be something wrong - like I said, I didn't actually run
> the sample :)  I see if I can take a look at it latter.

Actually, I'm running the test project vbg. I did grab the olelib.tlb
and put it in the same folder as the vbg.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
21 Aug 2010 4:50 AM
Jason Keats
GS wrote:
>
> Actually, I'm running the test project vbg. I did grab the olelib.tlb
> and put it in the same folder as the vbg.
>

Did you register the type library with regtlib.exe?
Author
21 Aug 2010 5:34 AM
Kevin Provance
"Jason Keats" <jke***@melbpcDeleteThis.org.au> wrote in message
news:sWIbo.4082$Yv.883@viwinnwfe01.internal.bigpond.com...
:
: Did you register the type library with regtlib.exe?

The easiest way to accomplish this is to find that file via the VB
references window, using the BROWSE button.  Once selected and OK is
clicked, the file is registered for you.  At least that's been my
experience.
Author
21 Aug 2010 5:34 AM
Tom Shelton
on 8/20/2010, Jason Keats supposed :
> GS wrote:
>>
>> Actually, I'm running the test project vbg. I did grab the olelib.tlb
>> and put it in the same folder as the vbg.
>>
>
> Did you register the type library with regtlib.exe?

Good point, Jason...

GS - the typelib should be extracted to your system32 folder, and then
registered with regtlib.exe as Jason says.

--
Tom Shelton
Author
21 Aug 2010 5:59 PM
GS
Yes, the olelib.tlb is registered. Otherwise, would it not be flagged
as "MISSING!"?

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
21 Aug 2010 6:24 PM
ralph
On Sat, 21 Aug 2010 13:59:07 -0400, GS <gesan***@netscape.net> wrote:

>Yes, the olelib.tlb is registered. Otherwise, would it not be flagged
>as "MISSING!"?

Not quite correct.

"Missing" means that the 'component' information given in a VB project
file (form, etc) doesn't match what is found or not found on the box -
either information in the Registery, or physical or logical
(permissions) location of a component.
Author
21 Aug 2010 6:34 PM
ralph
On Sat, 21 Aug 2010 13:24:54 -0500, ralph <nt_consultin***@yahoo.net>
wrote:

>On Sat, 21 Aug 2010 13:59:07 -0400, GS <gesan***@netscape.net> wrote:
>
>>Yes, the olelib.tlb is registered. Otherwise, would it not be flagged
>>as "MISSING!"?
>
>Not quite correct.
>
>"Missing" means that the 'component' information given in a VB project
>file (form, etc) doesn't match what is found or not found on the box -
>either information in the Registery, or physical or logical
>(permissions) location of a component.

A likely scenario in this case, is the type library or the project has
been moved since type library was initially Registered and referenced
in the project.

-ralph
Author
21 Aug 2010 7:04 PM
GS
ralph was thinking very hard :
Show quoteHide quote
> On Sat, 21 Aug 2010 13:24:54 -0500, ralph <nt_consultin***@yahoo.net>
> wrote:
>
>> On Sat, 21 Aug 2010 13:59:07 -0400, GS <gesan***@netscape.net> wrote:
>>
>>> Yes, the olelib.tlb is registered. Otherwise, would it not be flagged
>>> as "MISSING!"?
>>
>> Not quite correct.
>>
>> "Missing" means that the 'component' information given in a VB project
>> file (form, etc) doesn't match what is found or not found on the box -
>> either information in the Registery, or physical or logical
>> (permissions) location of a component.
>
> A likely scenario in this case, is the type library or the project has
> been moved since type library was initially Registered and referenced
> in the project.
>
> -ralph

Not the case, Ralph. I downloaded both into the same folder and
registered the lib there.

Just to clarify, other streams are writing but they display gobbly-gook
in the props dialog 'Advanced' view. Data being passed to the
olelib.tlb is returned either as an empty string or binary junk.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
21 Aug 2010 8:40 PM
ralph
On Sat, 21 Aug 2010 15:04:40 -0400, GS <gesan***@netscape.net> wrote:

Show quoteHide quote
>ralph was thinking very hard :
>> On Sat, 21 Aug 2010 13:24:54 -0500, ralph <nt_consultin***@yahoo.net>
>> wrote:
>>
>>> On Sat, 21 Aug 2010 13:59:07 -0400, GS <gesan***@netscape.net> wrote:
>>>
>>>> Yes, the olelib.tlb is registered. Otherwise, would it not be flagged
>>>> as "MISSING!"?
>>>
>>> Not quite correct.
>>>
>>> "Missing" means that the 'component' information given in a VB project
>>> file (form, etc) doesn't match what is found or not found on the box -
>>> either information in the Registery, or physical or logical
>>> (permissions) location of a component.
>>
>> A likely scenario in this case, is the type library or the project has
>> been moved since type library was initially Registered and referenced
>> in the project.
>>
>> -ralph
>
>Not the case, Ralph. I downloaded both into the same folder and
>registered the lib there.
>

And then did you also reset References in the VB Project to the
location of the type library?

But that only concerns the "Missing" reference part of your questions,
and was only a guess.

>Just to clarify, other streams are writing but they display gobbly-gook
>in the props dialog 'Advanced' view. Data being passed to the
>olelib.tlb is returned either as an empty string or binary junk.

Since you are getting errors I assume you have repaired the 'missing'
problem, otherwise if your code is somehow still running yet dependent
on a 'miss-matched' reference - all bets are off as to what is
happening.

Another blind guess on my part (and assuming you no longer have a
'missing' reference) is that your 'strange data' may be an encoding
problem which I mentioned before. Note, that not only is the data
stored in a binary format (and may be a struct and not just a single
'string'), but that stream names and labels/elements/properties can
also have odd characters in them (other than the usual A-z, 0-9, _,
etc 'legal' characters). Always treat the data as a block of Bytes,
and expect you might have do some additional mining/parsing.

However, remember I'm the one who suggested you not to go there, so
take my 'guesses' with a grain of salt. <bg>.

I, like many developers, fell in love with ADSs when they were first
introduced, as well as an associated technology of 'Versioning'. I
found that if designing your own custom formats, interfaces, and
protocols - within a single problem domain - the WinAPI works just
fine. However, when it came to also working with different platforms
or attempting to replace or mimic Windows and Office utilities - there
was always trouble. So except for special custom applications - I
recommend using the MS utilities.

-ralph
Author
21 Aug 2010 11:08 PM
GS
ralph laid this down on his screen :
Show quoteHide quote
> On Sat, 21 Aug 2010 15:04:40 -0400, GS <gesan***@netscape.net> wrote:
>
>> ralph was thinking very hard :
>>> On Sat, 21 Aug 2010 13:24:54 -0500, ralph <nt_consultin***@yahoo.net>
>>> wrote:
>>>
>>>> On Sat, 21 Aug 2010 13:59:07 -0400, GS <gesan***@netscape.net> wrote:
>>>>
>>>>> Yes, the olelib.tlb is registered. Otherwise, would it not be flagged
>>>>> as "MISSING!"?
>>>>
>>>> Not quite correct.
>>>>
>>>> "Missing" means that the 'component' information given in a VB project
>>>> file (form, etc) doesn't match what is found or not found on the box -
>>>> either information in the Registery, or physical or logical
>>>> (permissions) location of a component.
>>>
>>> A likely scenario in this case, is the type library or the project has
>>> been moved since type library was initially Registered and referenced
>>> in the project.
>>>
>>> -ralph
>>
>> Not the case, Ralph. I downloaded both into the same folder and
>> registered the lib there.
>>
>
> And then did you also reset References in the VB Project to the
> location of the type library?
>
> But that only concerns the "Missing" reference part of your questions,
> and was only a guess.

This is not an issue as the code recognizes the lib.
Show quoteHide quote
>
>> Just to clarify, other streams are writing but they display gobbly-gook
>> in the props dialog 'Advanced' view. Data being passed to the
>> olelib.tlb is returned either as an empty string or binary junk.
>
> Since you are getting errors I assume you have repaired the 'missing'
> problem, otherwise if your code is somehow still running yet dependent
> on a 'miss-matched' reference - all bets are off as to what is
> happening.
>
> Another blind guess on my part (and assuming you no longer have a
> 'missing' reference) is that your 'strange data' may be an encoding
> problem which I mentioned before. Note, that not only is the data
> stored in a binary format (and may be a struct and not just a single
> 'string'), but that stream names and labels/elements/properties can
> also have odd characters in them (other than the usual A-z, 0-9, _,
> etc 'legal' characters). Always treat the data as a block of Bytes,
> and expect you might have do some additional mining/parsing.

And so I assume this is happening within the lib because it fails
immediately at the line that passes the value into the lib.

Also, it appends all text with a vbNull character before passing the
value.

Keep in mind that this is the sample project running as supplied.
Whatever the dependancy it uses the olelib.tlb for just isn't working!
Here's what it returns for the Revision prop:
  ØJ
???????????????
I think the author missed something before releasing this as a demo
because the compiled EXE displays the same behavior.
Show quoteHide quote
>
> However, remember I'm the one who suggested you not to go there, so
> take my 'guesses' with a grain of salt. <bg>.
>
> I, like many developers, fell in love with ADSs when they were first
> introduced, as well as an associated technology of 'Versioning'. I
> found that if designing your own custom formats, interfaces, and
> protocols - within a single problem domain - the WinAPI works just
> fine. However, when it came to also working with different platforms
> or attempting to replace or mimic Windows and Office utilities - there
> was always trouble. So except for special custom applications - I
> recommend using the MS utilities.
>
> -ralph

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
22 Aug 2010 12:25 AM
Nobody
"GS" <gesan***@netscape.net> wrote in message
news:i4pma3$goq$1@news.eternal-september.org...
> Also, it appends all text with a vbNull character before passing the
> value.

vbNull is a constant used exclusively by VarType function, which gets the
subtype of a Variant, and it equals 1, but it's clear that you meant to say
a null character. There is also vbNullString, which is a special constant
that is used in API functions to specify a NULL pointer for a parameter that
is declared As String.
Author
22 Aug 2010 2:59 AM
GS
Nobody submitted this idea :
> "GS" <gesan***@netscape.net> wrote in message
> news:i4pma3$goq$1@news.eternal-september.org...
>> Also, it appends all text with a vbNull character before passing the value.
>
> vbNull is a constant used exclusively by VarType function, which gets the
> subtype of a Variant, and it equals 1, but it's clear that you meant to say a
> null character. There is also vbNullString, which is a special constant that
> is used in API functions to specify a NULL pointer for a parameter that is
> declared As String.

You're right! Thanks for pointing that out.<g>

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
3 Sep 2010 8:38 PM
Karl E. Peterson
GS wrote on 8/21/2010 :
> Just to clarify, other streams are writing but they display gobbly-gook in
> the props dialog 'Advanced' view. Data being passed to the olelib.tlb is
> returned either as an empty string or binary junk.

I know this is old, but that sounds an awful lot like a Unicode<->ANSI
issue of some sort?

--
..NET: It's About Trust!
http://vfred.mvps.org
Author
19 Aug 2010 10:23 PM
Tom Shelton
ralph used his keyboard to write :
Show quoteHide quote
> On Thu, 19 Aug 2010 10:22:28 -0400, GS <gesan***@netscape.net> wrote:
>
>> Just to follow through on a previous post "How to get the File
>> Properties", is there a way to write these properties using Shell?
>>
>> I'm looking for a way to do this without having to use an external
>> component such as DsoFile.dll or dwProp.dll. Any suggestions are
>> appreciated!
>
> For general properties such as date and attributes take a look at
> SetFileTime and SetFileAttributes.
>
> But I think you are after the extend properties (alternate data
> streams). Is that correct? If so then you are better off using dso or
> dwProp. I've never seen a reliable way of doing it in VB, not to say
> one doesn't exist. (After all you can do some writing with a batch
> file.) Also consider that these data streams are slightly different on
> different O/Ss so using these components will make your app more
> portable.
>
> If it is for a production or shrinkwrap app, use the components - your
> life will be easier. If you have an overwhelming need to not use them,
> or you just want to play with the idea - then stay tuned, I'm sure
> someone will be along with a robust method to make a liar out of me.
> <g>
>
> -ralph

Actually, I just did a little playing - and it appears you can manage
custom ADS streams in VB6 using the built in File IO...  At least the
reading and writing part...


Open "dummy.txt" For Output As #1
Open "dummy.txt:mystream.txt" For Output As #2

Write #1, "some stuff"
Write #2, "alternate stuff"

Close #2
Close #1

Open "dummy.txt:mystream.txt" For Input As #1
Dim s As String
Line Input #1, s
MsgBox s
Close #1


Works fine.  dummy.txt:mystream.txt is not visible form dir from the
commandline or in explorer.  If I do:

notepad dummy.txt:mystream.txt

at the command line the file is found and opend.  If I delete
dummy.txt, then dummy.txt:mystream.txt is also deleted.  The standard
vb kill will also kill the stream as well.

I did fine though, dir will not enumerate the stream - so, you can't
use dir to iterate streams - you would still need the
BackupRead/BackupSeek api's to iterate streams on the file...

By the way, I only put the .txt extension on the stream file so that I
could get notepad to open - because otherwise it kept trying to take on
the .txt and wouldn't find the stream :)

HTH

--
Tom Shelton
Author
19 Aug 2010 10:31 PM
Kevin Provance
"Tom Shelton" <tom_shelton@comcast.invalid> wrote in message
news:i4katn$pvm$1@news.eternal-september.org...
:
: Actually, I just did a little playing - and it appears you can manage
: custom ADS streams in VB6 using the built in File IO...  At least the
: reading and writing part...

Or, instead of listening to some chump who is frowned upon by this community
for his trolling and MSFT evengelism, you could always look at a sample
written by a reputable member of the classic vb community who actually put
some real time and effort into the project.

I think the choice is clear.

--
The *real* Tom Shelton:  I dont' care what you say or think.  I will post
any response anywhere I see fit.  So, FOAD.
Author
19 Aug 2010 10:38 PM
GS
Kevin Provance used his keyboard to write :
> "Tom Shelton" <tom_shelton@comcast.invalid> wrote in message
> news:i4katn$pvm$1@news.eternal-september.org...
>>
>> Actually, I just did a little playing - and it appears you can manage
>> custom ADS streams in VB6 using the built in File IO...  At least the
>> reading and writing part...
>
> Or, instead of listening to some chump who is frowned upon by this community
> for his trolling and MSFT evengelism, you could always look at a sample
> written by a reputable member of the classic vb community who actually put
> some real time and effort into the project.
>
> I think the choice is clear.

Kevin, where can I find such a sample? I've scoured my usual sources
and found nothing that suggests a VB version of dsofile or dwprop!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
19 Aug 2010 10:49 PM
Kevin Provance
"GS" <gesan***@netscape.net> wrote in message
news:i4kbok$227$1@news.eternal-september.org...
:
: Kevin, where can I find such a sample? I've scoured my usual sources
: and found nothing that suggests a VB version of dsofile or dwprop!
:

Sorry, the C&P didn't make it.  Here you go:
http://vb.mvps.org/samples/Streams/
Author
19 Aug 2010 11:38 PM
GS
Kevin Provance explained :
> "GS" <gesan***@netscape.net> wrote in message
> news:i4kbok$227$1@news.eternal-september.org...
>>
>> Kevin, where can I find such a sample? I've scoured my usual sources
>> and found nothing that suggests a VB version of dsofile or dwprop!
>>
>
> Sorry, the C&P didn't make it.  Here you go:
> http://vb.mvps.org/samples/Streams/

Hi Kevin,
Thanks! I actually looked at this some time ago. It's about ADS, which
can't be displayed in Windows Explorer; -not suitable for my
application.

Mind you, since these SummaryProperties can no longer be viewed in WE
(Win6x +) I may drop this altogether. That's not to say that they can't
be written in the newer OSs so they can be viewed on earlier vers. I'll
look into this on my Win7 machine just to verify that the FS supports
these props even though they won't let us view them in WE. I expect
they will persist since they're indiginous to NTFS, but ya' never know
what M$ has done there until you test!

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
3 Sep 2010 8:42 PM
Karl E. Peterson
GS submitted this idea :
> Mind you, since these SummaryProperties can no longer be viewed in WE (Win6x
> +) I may drop this altogether. That's not to say that they can't be written
> in the newer OSs so they can be viewed on earlier vers. I'll look into this
> on my Win7 machine just to verify that the FS supports these props even
> though they won't let us view them in WE. I expect they will persist since
> they're indiginous to NTFS, but ya' never know what M$ has done there until
> you test!

If I understand what you're looking for, I see them (Windows 7 x64) in
the file's Properties-Details tab?

--
..NET: It's About Trust!
http://vfred.mvps.org
Author
3 Sep 2010 11:55 PM
GS
> If I understand what you're looking for, I see them (Windows 7 x64) in the
> file's Properties-Details tab?

Those would be the ADS CustomProperties everyone is talking about. The
issue is that they won't display in WE's optional columns as the
SummaryProperties do in XP because the OS NTFS doesn't support the
SummaryProperties.

The advantage to displaying these in WE is so my user doesn't require
running the app. Otherwise, all they see in the WE listview is the
default data. Not very helpful when looking for a specific file if all
that identifies it is its non-descriptive filename. Keep in mind that
these CNC prog files are just plain text files, usually numeric named,
and typically will not have file extensions.

Example filenames:

  O0001
  O0002
  O0100
  O0101
....

My app reads/writes these into the file contents so they follow with
the file to non-NTFS volumes. Writing them to NTFS SummaryProperties is
only a convenience for my users.<g>

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
7 Sep 2010 10:28 PM
Karl E. Peterson
GS wrote on 9/3/2010 :
>> If I understand what you're looking for, I see them (Windows 7 x64) in the
>> file's Properties-Details tab?
>
> Those would be the ADS CustomProperties everyone is talking about. The issue
> is that they won't display in WE's optional columns as the SummaryProperties
> do in XP because the OS NTFS doesn't support the SummaryProperties.

What's WE, Windows Explorer?  I just toggled on Title and Subject quite
easily.

Still Puzzled...

--
..NET: It's About Trust!
http://vfred.mvps.org
Author
8 Sep 2010 12:09 AM
GS
> What's WE, Windows Explorer?  I just toggled on Title and Subject quite
> easily.
>
> Still Puzzled...

Yeah, that's what's confusing everyone about what I want to do. What
you see in WindowsExplorer under XP and earlier is different than what
you see in Vista/Win7. Earlier OSs used to support the NTFS
SummaryProperties on the Summary tab. This is missing in Vista/Win7,
and any files being transfered to the file system is stripped of this
metadata.

Not sure what Title/Subject you're refering to other than the data
written to the Details tab. These streams need to be written via ADS
procs people have pointed me to. Unfortunately, these aren't supported
for plain text files on Win6+ OSs.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
8 Sep 2010 12:15 AM
GS
Actually, those values you mention (Tilte, Subject) would be written to
the Custom tab for files that support those streams.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc
Author
8 Sep 2010 12:54 AM
Karl E. Peterson
GS submitted this idea :
Show quoteHide quote
>> What's WE, Windows Explorer?  I just toggled on Title and Subject quite
>> easily.
>>
>> Still Puzzled...
>
> Yeah, that's what's confusing everyone about what I want to do. What you see
> in WindowsExplorer under XP and earlier is different than what you see in
> Vista/Win7. Earlier OSs used to support the NTFS SummaryProperties on the
> Summary tab. This is missing in Vista/Win7, and any files being transfered to
> the file system is stripped of this metadata.
>
> Not sure what Title/Subject you're refering to other than the data written to
> the Details tab. These streams need to be written via ADS procs people have
> pointed me to. Unfortunately, these aren't supported for plain text files on
> Win6+ OSs.

Hmmmm, well, they were actually written by Word.  Yeah, you're right,
they're not exactly the same as in XP, I guess.  I didn't realize you
couldn't do that with TXT files anymore, either.  Huh...

--
..NET: It's About Trust!
http://vfred.mvps.org
Author
20 Aug 2010 9:04 AM
Mike Williams
"Kevin Provance" <k@p.c> wrote in message
news:i4kcdn$7pe$1@news.eternal-september.org...
> "GS" <gesan***@netscape.net> wrote in message
> news:i4kbok$227$1@news.eternal-september.org...
> :
> : Kevin, where can I find such a sample? I've scoured my
> : usual sources and found nothing that suggests a VB
> : version of dsofile or dwprop!
>
> Sorry, the C&P didn't make it.  Here you go:
> http://vb.mvps.org/samples/Streams/

That's the same one Shelton looked at just before he posted a small
obfuscated sample.

Mike
Author
20 Aug 2010 2:49 PM
Tom Shelton
Show quote Hide quote
On Aug 20, 3:04 am, "Mike Williams" <M***@WhiskyAndCoke.com> wrote:
> "Kevin Provance" <k...@p.c> wrote in message
>
> news:i4kcdn$7pe$1@news.eternal-september.org...
>
> > "GS" <gesan***@netscape.net> wrote in message
> >news:i4kbok$227$1@news.eternal-september.org...
> > :
> > : Kevin, where can I find such a sample? I've scoured my
> > : usual sources and found nothing that suggests a VB
> > : version of dsofile or dwprop!
>
> > Sorry, the C&P didn't make it.  Here you go:
> >http://vb.mvps.org/samples/Streams/
>
> That's the same one Shelton looked at just before he posted a small
> obfuscated sample.
>
> Mike

Nope...  Figured it out on  my own.  It wasn't a huge leap from, "hey
i can create these things with notepad on the command line, to hey,
maybe I'll just try it out".  I already new the basics of this, as I
have used them in the past in C#...

And before you jump on me, the reason I even mention C#, is that in
this instance, the advantage goes to VB 6.  It's actually slightly
easier to work with ADS in VB6 then C#...  The reason is that the .net
io classes check for illegal characters in file names, and : is
considered an illegal character - which is stupid, IMHO, because they
are not illegal, they just have special meaning...  But, the fact is
that the IO classes disallow all special meaning characters (like \\?\
for greater the max_path path's) - so, you can't open these sort of
files using the standard I/O mechanisms of .NET.  You have to use P/
Invoke to use CreateFileEx to get a system handle, wrap that in a
safehandle, and then pass that to the i/o stream's constructor....
After that, everything is normal -  but, initialization is a pain....

--
Tom Shelton
Author
20 Aug 2010 3:12 PM
Kevin Provance
"Tom Shelton" <tom_shel***@comcast.net> wrote in message
news:3f41a304-03d7-4d17-8818-e9e9d13eb522@u31g2000pru.googlegroups.com...

<cut>

Did any ask about that other platform that is off topic here?  Mike?  GS?
No? I didn't think so.

Any excuse, right Skelton?  No one bloody asked, so what's your excuse this
time?

One of these days I'm going to have to give Barb a call and find out if you
were like this growing up - a real pain in the balls who defied authority
and thrust his will in places where it wasn't wanted.

--

- K

The *real* Tom Shelton:  I dont' care what you say or think.  I will post
any response anywhere I see fit.  So, FOAD. (Is that the Ingenix mission
statement?)
Author
21 Aug 2010 9:54 AM
Nobody
"GS" <gesan***@netscape.net> wrote in message
news:i4jen7$5oh$1@news.eternal-september.org...
> Just to follow through on a previous post "How to get the File
> Properties", is there a way to write these properties using Shell?
>
> I'm looking for a way to do this without having to use an external
> component such as DsoFile.dll or dwProp.dll. Any suggestions are
> appreciated!

See this sample
Author
21 Aug 2010 9:57 AM
Nobody
"GS" <gesan***@netscape.net> wrote in message
news:i4jen7$5oh$1@news.eternal-september.org...
> Just to follow through on a previous post "How to get the File
> Properties", is there a way to write these properties using Shell?
>
> I'm looking for a way to do this without having to use an external
> component such as DsoFile.dll or dwProp.dll. Any suggestions are
> appreciated!

Sorry, clicked Send too soon. See this sample if you want to see and
manipulate alternate data streams:

http://vb.mvps.org/samples/Streams/
Author
21 Aug 2010 3:06 PM
Kevin Provance
"Nobody" <nob***@nobody.com> wrote in message
news:i4o7v5$nvj$1@speranza.aioe.org...
:
: Sorry, clicked Send too soon. See this sample if you want to see and
: manipulate alternate data streams:
:
: http://vb.mvps.org/samples/Streams/
:

In case you are not keeping up, I posted that a few days back.
Author
23 Aug 2010 9:58 PM
GS
Thanks to all for your input on this topic! The resulting decision is
that I'll stick with using dwProp.dll and DsoFile.dll while XP persists
to be the major OS with my users.

As reported, the SummaryInformation is no longer supported by Win6/7
and so it looks like I'll eventually drop writing these properties. My
app reads the same values directly from the file contents and so
providing this info in the form of SummaryProperties is only a
convenience to the user to obviate the need for licensing multiple
installs of my app. Gee.., this might result in having to
sell/distribute more seat licenses!<g>

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc