Setting the Title property in a Windows File ...

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I hope I am just missing something easy, and that someone can point me in
the right direction, but I cannot seem to find out how to change the title
property of any random file using VB.NET.



For example, in Notepad, with a saved text file, one can right click on the
file and go to properties, and then go to the third tab [called Summary];
here there is a property called Title, and it is this that i wish to change,
and have found ways to get close to it, but not quite.



I know I can use this command to get ahold of some data from a file:

My.Computer.FileSystem.GetFileInfo Method



But in the documentation, as well as when running the code, it doesn't say
anything about being able to get or set or see the Title property.





Granted, my main goal in all of this is to be able to enable me to write a
program so that my MP3 player will have more descriptive titles, but even if
that weren't the case, I still would like to know why I'm missing the extra
part of the data for the file and can't change it.





Any help would be great. Thanks so much for your time!



In peace.
 
Hello Scott,

On 2k and XP NTFS formatted systems the "Title" attribute (as well as all
other data on the Summary tab) is stored in an Alternate data stream. (See
the MSDN doco). The reason the .NET framework doesnt expose this data (I'm
assuming) is that the .NET framework doesn't know anything about Alternate
data streams (as it's NTFS-specific).

-Boo
 
Thank you both for answering... perhaps I can find a direction to go from
there.
scott.


R. MacDonald said:
Hello, Scott,

But (further to what Ghost said), if you still want to try to use these
properties, you will need to use DSOFile.dll. For more information see:

http://support.microsoft.com/?kbid=224351

but to avoid problems, also take a look at:

http://www.codecomments.com/archive293-2006-2-813451.html

Cheers,
Randy

I hope I am just missing something easy, and that someone can point me in
the right direction, but I cannot seem to find out how to change the
title property of any random file using VB.NET.



For example, in Notepad, with a saved text file, one can right click on
the file and go to properties, and then go to the third tab [called
Summary]; here there is a property called Title, and it is this that i
wish to change, and have found ways to get close to it, but not quite.



I know I can use this command to get ahold of some data from a file:

My.Computer.FileSystem.GetFileInfo Method



But in the documentation, as well as when running the code, it doesn't
say anything about being able to get or set or see the Title property.





Granted, my main goal in all of this is to be able to enable me to write
a program so that my MP3 player will have more descriptive titles, but
even if that weren't the case, I still would like to know why I'm missing
the extra part of the data for the file and can't change it.





Any help would be great. Thanks so much for your time!



In peace.
 
Back
Top