vbscript >> Changing Extended File properties

by VkhH » Fri, 21 Apr 2006 00:52:02 GMT

In VBScript I can use the command "GetDetailsOf" to acquire all properties of
a particular file (35 properties are listed). I want to know if there is a
VBA script method or command I can use to change these properties of a file.
I would like to alter some of the properties of mp3 file (e.g. property
"album" or "genre") so I can create new groups based on my own division

Kind regards,

Gilbert Van Hauwe

vbscript >> Changing Extended File properties

by Ziminski » Fri, 21 Apr 2006 06:39:11 GMT

take a look at objFile.Attributes

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("C:\FSO\TestScript.vbs")

If objFile.Attributes = objFile.Attributes AND 1 Then
objFile.Attributes = objFile.Attributes XOR 1
End If

On Thu, 20 Apr 2006 09:52:02 -0700, VHG

vbscript >> Changing Extended File properties

by Michael Harris (MVP) » Fri, 21 Apr 2006 11:33:27 GMT

Unfortunately the Shell.Automation object model does not expose any
SetDetailsOf counterpart of GetDetailsOf and I know of no other scriptable
way to do so. Many people have asked over the years to no avail.

Michael Harris
Microsoft MVP Scripting

Similar Threads

1. Change the 'Extend my windows desktop...' property - VB.Net

2. Getting Extended File Properties

I need to obtain the extended file properties, such as Owner, Title, etc, 
for a file in a .net program.  I have looked through the FileInfo class and 
I cannot see any methods or properties that will expose this.  In the old 
days we used to use GetFileInfo but I don't see it in .Net anywhere.

How can I get this information?

3. Reading/Writing Extended File Properties - VB.Net

4. Extended file properties

I have searched the forum for tips on how to get extended file
properties, but haven't had any luck yet.  What I'm after specifically
is version information, such as that found when a file is
right-clicked in Windows Explorer, then under the Version tab.  The
number given for Product Version would be perfect.  I need to get this
information using only VBScript if possible.  I know about
GetDetailsOf, but have not been able to get that to give me version. 
It may be that what I'm trying to do is not possible.
Also, is there a list somewhere that shows all the columns available
with GetDetailsOf?  I saw a page at Microsoft that only had 4 or 5,
but I've seen some code that went up to 33 or so.  Thanks in advance
for any help.

5. Missing extended file properties

6. Extended File Properties


Using some code I found on the web I can read the Extended file properties.

Some of the properties are clearly read only, but how can I change the 
ones which aren't?

Function GetFileInformation() As Boolean
On Error GoTo ErrorHandler
Dim arrHeaders(35)
   Set objShell = CreateObject("Shell.Application")
   Set objfolder = objShell.Namespace("C:\TestFolder")
   For i = 0 To 34
    arrHeaders(i) = objfolder.GetDetailsOf(objfolder.Items, i)
   For Each strFileName In objfolder.Items
    For i = 0 To 34
    Debug.Print i & vbTab & arrHeaders(i) & ": " _
           & objfolder.GetDetailsOf(strFileName, i)
   GetFileInformation = True
   Exit Function
   MsgBox "Unable to process data in Function 'GetFileInformation' due 
to:" & vbCrLf & Err.Description, vbCritical
   GetFileInformation = False
End Function  ' GetFileInformation


Laurie Comerford

7. set text file extended property - Visual Basic/VB

8. Retrieving extended file properties

I'm trying to figure out, using VB6, how to obtain extended file properties.  The properties I'm concerned with are the properties that appear on the Summary tab when you right-click a file (such as a .txt file) and select properties.  I need to obtain items such as "Author", "Title", "Keywords", "Comments", etc.  Also, if the file is an image (.jpg, etc.) there are extended image properties (perhaps windows generates these on the fly??) that I'm interested in.  Does anyone know how to get this info?

Thanks in advance,