How can I extract the names of games of which I added shortcuts to Steam from a shortcuts.vdf file?

Solution 1:

Here is a very hacky bit of vbscript which essentially breaks down the shortcuts.vdf file into seperate lines (based on the nul character) and then spits out the next line after the one called AppName. I did try to just split file using Chr(0) as the delimiter but it threw an error .

Save the following file as steam.vbs:

Dim oFile: Set oFile = CreateObject("Scripting.FileSystemObject").GetFile("shortcuts.vdf")
Dim file : file = oFile.OpenAsTextStream().Read(oFile.Size)

Dim content, i, c

For i = 1 To Len(file)
    c = Asc(Mid(file, i, 1))
    If c = 0 Then 
        content = content & VbCrLf
    ElseIf c > 3 Then
        content = content & Chr(c)
    end If
Next

Dim items : items = Split(content, VbCrLf)

For i = 0 To Ubound(items)
    If Instr(LCase(items(i)), "appname") > 0 Then Wscript.Echo items(i+1)
Next

Set oFile = Nothing

Copy the shortcuts.vcf file into the same folder as this code and then from a command line type:

cscript steam.vbs > output.txt

Open the output in any text editor and you'll see a list of all the game shortcuts you have added.