Adding multiple steam desktop shortcuts

I wrote this AutoHotkey script to generate shortcuts (no icon images though)

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

Loop, *, 0, 0
{
    if RegExMatch(A_LoopFileName, "appmanifest_\d+\.acf") {
        FileToRead = %A_LoopFileName%
        TempFile := "shortcuts_tempinfo.txt"
        FileDelete, %TempFile%
        RunWait,shortcuts.bat %FileToRead% >> %TempFile%,,Hide
        FileRead,Output,%TempFile%
        FileDelete,%TempFile%
        FoundPos := RegexMatch(Output, """name"".*?""(.*?)""", SubPat)
        Name := RegExReplace(SubPat1, "[^a-zA-Z0-9 ]")
        StringReplace, LoopFileName, A_LoopFileName, appmanifest_
        StringReplace, LoopFileName, LoopFileName, .acf
        IniWrite, steam://rungameid/%LoopFileName%, %A_Desktop%\%Name%.url, InternetShortcut, URL
    }
}
MsgBox, Finished

It needs to be placed inside your SteamApps folder with shortcuts.bat (below)

@echo off
type %1

The script scans through your appmanifest files and creates desktop shortcuts like Steam would, except for the missing icon. (I couldn't figure out a way to find the icon for a game yet due to varying game folder structures)


This may not be perfect, as some game folders contain multiple executables, but I've just tested the following on my work system (which only has a few games installed)

  • Navigate to your Steam Common Apps folder:

    (commonly C:\Program Files (x86)\Steam\SteamApps\common)

  • Use the Search function in the top right corner and search for *.exe

  • Select the games from the resulting search you wish to create shortcuts for using ctrl+left click

  • Right click, and select send to > desktop

Not perfect, but it should be faster than manually selecting them!

Tags:

Steam