Using VBscript to change extract the "Contributing Artists" information from a WMA file

Based on give WMA file (pls rename 03 Mickey.myyapp to 03 Mickey.wma)
Given this WMA (Window Media Audio) file has information about Singer, Album etc.

(under Window7 or above)

I want a VBscript to :

1) extract the information of "Contributing Artists"
2) Add the information from (1) as the prefix to the file name

If you are including any library object, please also advise how to download the library and how to install the library.

Thank you,

David
03-Mickey.myapp
tindavidAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

omgangIT ManagerCommented:
This should do it.  I modified the vbscript function found here http://stackoverflow.com/questions/2976734/how-to-retrieve-a-files-product-version-in-vbscript

OM Gang



Option Explicit

Dim FSO
Dim sFilePath, sProgram, sContribArt, sNewName

Set FSO = CreateObject("Scripting.FileSystemObject")

sFilePath = "c:\test3"
sProgram = "03-Mickey.wma"

sContribArt = GetContribArt(sFilePath, sProgram)

      'rename the file
sNewName = sContribArt & "_" & sProgram
FSO.MoveFile sFilePath & "\" & sProgram, sFilePath & "\" & sNewName

Function GetContribArt (sFilePath, sProgram)
Dim FSO, objShell, objFolder, objFolderItem, i

    Set objShell = CreateObject("Shell.Application")
    Set objFolder = objShell.Namespace(sFilePath)
    Set objFolderItem = objFolder.ParseName(sProgram)
    Dim arrHeaders(300)
    For i = 0 To 13
        arrHeaders(i) = objFolder.GetDetailsOf(objFolder.Items, i)
        'WScript.Echo i &"- " & arrHeaders(i) & ": " & objFolder.GetDetailsOf(objFolderItem, i)
        If lcase(arrHeaders(i))= "contributing artists" Then
            GetContribArt = objFolder.GetDetailsOf(objFolderItem, i)
            Exit For
        End If
    Next

End Function
0
omgangIT ManagerCommented:
The original script had

For i = 0 To 300

You should change it back to that.  I changed it to 13 for testing with the WScript.Echo uncommented.
OM Gang
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tindavidAuthor Commented:
Great solution.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.