shellproperty.exe v2: read all properties on a file; set properties of certain non-VT_LPWSTR types

I updated my toy app to set/read shell properties from the command line. New features:

  1. Read all the properties from a given file in one go.
  2. Recognize properties by their canonical name (if they have one.)
  3. Set a property to VT_EMPTY (removing it), or “VT_VECTOR | VT_LPWSTR”, or VT_UI4, in addition to VT_LPWSTR.


shellproperty read [ <key> | all ] from <filename>
shellproperty set <key> on <filename> to <vartype> <vartype-specific-arguments>


Example of reading all properties from a file:

>shellproperty read all from “I 01 Track 1.mp3” | sort
{9E5E05AC-1936-4A75-94F7-4704B8B01923} 0: VT_BSTR I 01 Track 1.mp3
{CFA31B45-525D-4998-BB44-3F7D81542FA4} 1: VT_LPWSTR MP3
System.Audio.ChannelCount: 2 (stereo)
System.Audio.EncodingBitrate: 320kbps
System.Audio.Format: {00000055-0000-0010-8000-00AA00389B71}
System.Audio.IsVariableBitRate: No
System.Audio.PeakValue: 23841
System.Audio.SampleRate: 44 kHz
System.Audio.SampleSize: 16 bit
System.Audio.StreamNumber: 0
System.Author: Unknown artist
System.ComputerName: MATEER-D (this PC)
System.ContentType: audio/mpeg
System.DateAccessed: 9/3/2013 5:55 PM
System.DateCreated: 9/3/2013 5:55 PM
System.DateImported: 9/3/2013 5:55 PM
System.DateModified: 9/24/2013 3:21 PM
System.Document.DateCreated: 9/3/2013 5:55 PM
System.Document.DateSaved: 9/24/2013 3:21 PM
System.DRM.IsProtected: No
System.FileAttributes: A
System.FileExtension: .mp3
System.FileName: I 01 Track 1.mp3
System.FileOwner: REDMOND\mateer
System.FilePlaceholderStatus: 7
System.IsFolder: Files
System.IsShared: No
System.ItemAuthors: Unknown artist
System.ItemDate: 9/3/2013 5:55 PM
System.ItemFolderNameDisplay: Les Misérables (concept album)
System.ItemFolderPathDisplay: C:\music\Claude-Michel Schönberg & Alain Boublil\Les Misérables (concept album)
System.ItemFolderPathDisplayNarrow: Les Misérables (concept album) (C:\music\Claude-Michel Schönberg & Alain Boublil)
System.ItemName: I 01 Track 1.mp3
System.ItemNameDisplay: I 01 Track 1.mp3
System.ItemNameDisplayWithoutExtension: I 01 Track 1
System.ItemParticipants: Unknown artist
System.ItemPathDisplay: C:\music\Claude-Michel Schönberg & Alain BoublilLes Misérables (concept album)\I 01 Track 1.mp3
System.ItemPathDisplayNarrow: I 01 Track 1 (C:\music\Claude-Michel Schönberg & Alain Boublil\Les Misérables (concept album))
System.ItemType: MP3 File
System.ItemTypeText: MP3 File
System.Kind: Music
System.KindText: Music
System.Media.AverageLevel: 4219
System.Media.ClassPrimaryID: {D1607DBC-E323-4BE2-86A1-48A42A28441E}
System.Media.ClassSecondaryID: {00000000-0000-0000-0000-000000000000}
System.Media.CollectionGroupID: {3B02CC9D-BE3E-43A4-81AA-DC23DFD20083}
System.Media.CollectionID: {3B02CC9D-BE3E-43A4-81AA-DC23DFD20083}
System.Media.ContentID: {3780156C-B516-4897-B6AC-CB632A0CA4A5}
System.Media.DlnaProfileID: MP3
System.Media.Duration: 00:04:47
System.Media.MCDI: E+96+54E9+98AD+A23C+DBD5+F62C+11889+15B50+170F9+1C1EC+1E01E+221A7+2916C+2C6EB+2F21A
System.Media.MetadataContentProvider: AMG
System.Media.Publisher: Colosseum
System.Media.UniqueFileIdentifier: AMGt_id=T 987037;AMGp_id=P 1857378;AMGa_id=R 189777;X_id={9D0F0F00-0500-11DB-89CA-0019B92A3933};XA_id={51E50200-0400-11DB-89CA-0019B92A3933};XAP_id={6357088C-778C-11DC-9403-0019B9B20868}
System.Media.Year: 1989
System.MIMEType: audio/mpeg
System.Music.AlbumArtist: Various Artists
System.Music.AlbumID: Various Artists – Les Miserables – French Concept Album: 1 of 2
System.Music.AlbumTitle: Les Miserables – French Concept Album: 1 of 2
System.Music.Artist: Unknown artist
System.Music.Composer: Alain Boublil; Claude-Michel Schönberg
System.Music.DisplayArtist: Various Artists
System.Music.Genre: Unknown genre
System.Music.PartOfSet: 1/1
System.Music.TrackNumber: 1
System.NotUserContent: No
System.OfflineAvailability: Available offline
System.ParsingName: I 01 Track 1.mp3
System.ParsingPath: C:\music\Claude-Michel Schönberg & Alain Boublil\Les Misérables (concept album)\I 01 Track 1.mp3
System.PerceivedType: Audio
System.SFGAOFlags: 1077936503
System.ShareScope: musicClaude-Michel Schönberg & Alain BoublilLes Misérables (concept album)
System.SharingStatus: Not shared
System.Shell.SFGAOFlagsStrings: filesys; stream
System.Size: 10.9 MB
System.ThumbnailCacheId: 16520045390528741485
System.Title: Track 1
System.VolumeId: {14FF6E9D-14F5-11E3-824C-806E6F6E6963}
System.ZoneIdentifier: 0

Example of updating a file:

>type _fixup.bat
@echo off

for /f "usebackq delims=" %%f in (`dir /s /b "I *.mp3"`) do (
    shellproperty set System.Music.AlbumTitle on "%%f" to VT_LPWSTR "Madama Butterfly - Sinopoli / Freni: 1 of 3"

for /f "usebackq delims=" %%f in (`dir /s /b "II *.mp3"`) do (
    shellproperty set System.Music.AlbumTitle on "%%f" to VT_LPWSTR "Madama Butterfly - Sinopoli / Freni: 2 of 3"

for /f "usebackq delims=" %%f in (`dir /s /b "III *.mp3"`) do (
    shellproperty set System.Music.AlbumTitle on "%%f" to VT_LPWSTR "Madama Butterfly - Sinopoli / Freni: 3 of 3"

Browse source

Download shellproperty.exe

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s