# Steam Shortcuts file and it's composition Non-game Steam library entries are stored in a special file called ```shortcuts.vdf```. The file is located in the ```(steam folder)\userdata\(steamid)\config``` folder for each Steam user. It is encoded using ANSI formating. Every file starts with the header ```\x00shortcuts\x00```, followed by all shortcut entries. After all entries, the file is terminated by ```\x08\x08```. As all entry end with the same byte combination, the last 4 bytes of a file are always ```\x08\x08\x08\x08``` ### Shortcut entry format ```🔤``` represents where to insert the value in the ```Format``` column. Bools are represented using ```\x00```(False) or ```\x01```(True). | Name | Description | Data Type | Format |:-:|:-:|:-:|:-: | EntryID | Represents numerical order of each entry | String | ```\x00🔤\x00``` | appid | Represents the unique Steam ID for the shortcut. See next section on how to obtain this value. | 4 Byte String | ```\x02appid\x00🔤``` | AppName | Name for the shortcut | String | ```\x01AppName\x00🔤\x00``` | Exe | Full quoted path for the executable | String | ```\x01Exe\x00🔤\x00``` | StartDir | Target directory where the executable will start in. Does not need quotes. | String | ```\x01StartDir\x00🔤\x00``` | icon | Path to the App's icon. Does not need quotes. | String | ```\x01icon\x00🔤\x00``` | ShortcutPath | Represents the unique Steam ID for the shortcut. (can be empty) | String | ```\x01ShortcutPath\x00🔤\x00``` | LaunchOptions | Launch parameters for the executable. | String | ```\x01LaunchOptions\x00🔤\x00``` | IsHidden | If the shortcut is in the hidden library section. | Bool | ```\x02IsHidden\x00🔤\x00\x00\x00``` | AllowDesktopConfig | If Desktop Configuration is allowed via Steam UI.| Bool | ```\x02AllowDesktopConfig\x00🔤\x00\x00\x00``` | AllowOverlay | If the overlay can be drawn over the executable. | Bool | ```\x02AllowOverlay\x00🔤\x00\x00\x00``` | OpenVR | If the executable uses OpenVR. | Bool | ```\x02OpenVR\x00🔤\x00\x00\x00``` | Devkit | If it is a shortcut to a DevKit. | Bool | ```\x02Devkit\x00🔤\x00\x00\x00``` | DevkitGameID | ID for the game related to the DevKit (can be empty) | String | ```\x01DevkitGameID\x00🔤\x00``` | DevkitOverrideAppID | Represents the unique Steam ID for the shortcut. | Bool | ```\x02DevkitOverrideAppID\x00🔤\x00\x00\x00``` | LastPlayTime | Represents the timestamp of the last time the shortcut was executed. | 4 byte String | ```\x02LastPlayTime\x00🔤``` | FlatpakAppID | The Flatpak ID for the executable (applies to Linux systems, can be empty) | String | ```\x01FlatpakAppID\x00🔤\x00``` | tags | Has information about the categories the shortcut is in. | String | ```\x00tags\x00🔤\x08\x08``` ### Generating a Steam ID 1. Append the Executable path (quoted) and the Shortcut Name (```Exe + AppName```) 2. Get a hash using CRC32. 3. Get the result from a OR operaton between this value and 0x80000000 (```crc32hash | 0x80000000```) 4. Shift the result by 32 bits to the left (```res3 << 32```) 5. Do another OR operation, but this time using 0x02000000 (```res4 | 0x02000000```) ### Grid Files A shortcut can contain various assets. These assets are not specified in the file above but are found in the ```grid``` folder next to the ```shortcuts.vdf``` file and have the shortcut's steamID in their name. 🔤 == steamID | Name | File Name Scheme | Example |:-:|:-:|:-: | Hero | ```🔤_hero.png``` | ![hero](https://cdn2.steamgriddb.com/hero_thumb/c73f4d8f3e0c84920eef1464c4c73cb8.jpg) | Logo | ```🔤_logo.png``` | ![logo](https://cdn2.steamgriddb.com/logo_thumb/6076036fdb272f49688c571013f3ede1.png) | Banner | ```🔤p.png``` | ![banner](https://cdn2.steamgriddb.com/thumb/f67ce25bb06e710ed8cca26bf7958d06.jpg) | Preview | ```🔤.png```| ![grid](https://cdn2.steamgriddb.com/thumb/7073e4df427844c68082181ff6c9c614.jpg) ### Special Thanks This documentation was based on some previous work found in the following links: - [CorporalQuesadilla's documentation](https://github.com/CorporalQuesadilla/Steam-Shortcut-Manager/wiki/Steam-Shortcuts-Documentation) - [Heroic Launcher source code](https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/blob/8bdee1383446d3b81e240a4300baaf337d48ec92/src/backend/shortcuts/nonesteamgame/nonesteamgame.ts) ### Implementation example - [Steam Shortcuts module (C# .NET)](https://github.com/CollapseLauncher/Collapse/tree/main/CollapseLauncher/Classes/ShortcutCreator) This is contribution to [Collapse Launcher](https://github.com/CollapseLauncher/Collapse), an open-source launcher by [neon-nyan](https://github.com/neon-nyan) for all miHoYo/Hoyoverse games.