Setting file summary properties

mjcatt

Member
Joined
Oct 22, 2003
Messages
5
Right-clicking on any file in windows explorer lets you access file properties, including title, subject, author, comments, etc.

How can I set these properties using .NET? The FileVersionInfo class lets you retrieve these properties but not set them; I have not found anything to let me set them. :confused:

Does anyone know how to do this? Thanks.
 
"Any" file in Windows Explorer does not have file properties such as title, subject, author, and comments. If I am not mistaken, those properties are specific to MS Office Documents... this information is located within the file itself. If you open up a Word File in Notepad, youll find all of this stuff located at the bottom.
So, in order to change this stuff, youre going to have to open the file and change those somehow (and itll probably be a little more than just finding the title and changing it, there could be length-prefixes in the file)... youd have to know the Word file specifications to do this.
 
No, they dont appear to be specific to OFFICE. I can change this info for most files by right-clicking the file in WINDOWS EXPLORER and selecting the PROPERTIES menu item and typing information on the SUMMARY tab (eg, AUTOCAD drawings, SOLIDWORKS part/assy files, vb, cls, jpg, zip, txt, dll, exe, pdf). Id like to know how do change this info via .NET.

Iceplug said:
"Any" file in Windows Explorer does not have file properties such as title, subject, author, and comments. If I am not mistaken, those properties are specific to MS Office Documents... this information is located within the file itself. If you open up a Word File in Notepad, youll find all of this stuff located at the bottom.
So, in order to change this stuff, youre going to have to open the file and change those somehow (and itll probably be a little more than just finding the title and changing it, there could be length-prefixes in the file)... youd have to know the Word file specifications to do this.
 
Does any information actually appear on the summary tab for all of those file types? The summary information is pulled from the contents of the file itself and differs depending on the file type. If you are using an office document then it is stored in a particular file format that allows summary information to be contained within it (search for Ole Compound File for more information.
Other file types (avi. jpg, mpeg amongst others) also contain information internal to the file - this information is displayed in explorer via a shell extension which knows how to read this embedded data.
Simple text files (.txt, .vb, .cs etc) do not have anywhere internal to the file to store this info.
 
Yes I do use NTFS and I am aware of the alternate data streams NTFS exposes (which are extra data associated with a filename and are not extra information stored within the same file), these are not the same as the file summary information mentioned in this thread. IIRC NTFS at one point was going to make more use of the alternate streams for such purposes as summary data and this functionality did briefly appear in Win2k betas but was later removed.
 
PlausiblyDamp said:
not extra information stored within the same file

Who said otherwise?


PlausiblyDamp said:
this functionality did briefly appear in Win2k betas but was later removed.

Then I must be in the Twilight Zone. Every Win2k and XP system Ive used has summary info for every NTFS file.
 
Im glad that this isnt how you guys always find an answer to other users questions.

PlausiblyDamp said:
Yes I do use NTFS and I am aware of the alternate data streams NTFS exposes (which are extra data associated with a filename and are not extra information stored within the same file)

Based on the described contents and behavior, I would say that this is exactly what mjcatt was referring to. If you are using Win Xp, go to a files properties and note the tab labeled "Summary". I am pretty sure, however, that the .Net Framework does not contain any classes that relate to these properties.

If you are talking about the alternate data streams, a google search lead me to http://www.relsoft.net/datastreams.html, which explains how ADS works. Some more googling should help you figure out how to access these properties. Just keep in mind that this is specific to NTFS (as far as I know). Dont assume all users will have this capability, and realize that you will be using pure platform invoke to do this.

P.S. As pointed out by PlausiblyDamp, the summary information found in the ADS is different from summary information which may be stored in office documents, jpegs, etc.
 
These posts do shed light on the subject. Im using XP and all files on NTFS drives have this summary info. Others (NSF-mounted UNIX, FAT, floppy, memory-stick, etc), do not present this summary info(except if they are file types that contain internal summary info, as PlausiblyDamp points out).

So I must decide if I want to confine myself to NTFS (admittedly not a really good idea). But if so, to complete thread on my original question, is there an NTFS API accessible from .NET that gives access to the file summary info?
 
:confused: I stand corrected, Ive never tried to manipulate the summary properties of a file through explorer for years, it does work :confused:
Even more annoying before doing the previous post I did attempt to try and nothing was visible and nothing could be edited! Turns out this is very dependant on the file type. .txt you can, .jpeg has additional and you can edit some, .gif and .bmp - nothing editable, .html no tab present. .com you cant but .exe you can.
Ignore my above post(s) - listen to marble_eater instead
 
Thats odd, I can modify the summary of all the files you mentioned except html.

As for accessing this data in .NET, youll have to use platform invoke, but thats OK since ADS isnt portable anyway.
 
Thanks to everyone for responding to my questions. Also thanks to PlausiblyDamp for the link to the interesting article about ADS. Sometimes a guided tour of an overgrown path is the best way to avoid a nasty case of poison oak...
 
Back
Top