Question Is there a way to merge Steam's "screenshots.vdf" from multiple computers into one ?

Cyber_Akuma

Distinguished
Oct 5, 2002
492
21
18,785
I have been using Steam on multiple computers and want to merge all of my screenshots I have been taking on them into my main system. The screenshots themselves are not a problem, you basically just copy over the folder(s) and after a painstaking time of Steam going "New screenshot taken!" for hours as it sorts through all the new screenshots it finds they are integrated into your library.

The problem is however that there is also a file called "screenshots.vdf" that seems to be a catalog/list of all of your screenshots taken in Steam in the "C:\Program Files (x86)\Steam\userdata\[user_number_here]\760\" folder. While Steam does appear to update and append any new screenshots to this file, the issue is that this file also stores if you wrote any captions/comments for any of your screenshots in it, which do NOT carry over if you just simply copy over the folders containing the screenshots.

I want to try to preserve all the comments I wrote too, is there any way to do this? Seems like the only way would be to merge the contents of the screenshots.vdf files, but I am not aware of any tool that can do that. I tried Googling about it, and I saw several tools mentioned but none appear to be designed specifically to do this.

The "SteaScree" tool came up a lot but that appears to be for adding external screenshots into your library, it can add them to the screenshots.vdf file but it doesn't appear to read other screenshots.vdf files and merge/copy entries. GameSave Manager was another that came up (and one I have used many times before to backup my saves) where I read some sites says it specifically does this, but it does not. It just copies the folders over and completely leaves the screenshots.vdf file untouched.

The file itself appears to basically just be a text file, and is very easily human-readable if you open it up in a text editor such as Notepad and the way it is organized is obvious, but I am not aware of any tools designed to actually parse and edit this file in such a way that it can merge the entries from different ones together. Are there any tools or other ways to do this? I have several thousand screenshots across hundreds of games to merge so doing it manually is not at all feasible.
 

Ralston18

Titan
Moderator
Not sure about the full process that seems to be required.

However if you google "Powershell merge parse files screenshots" you will find quite a number of links.

For example:

https://community.spiceworks.com/t/...-specific-line-from-txt-files-into-one/810157

https://learn.microsoft.com/en-us/p...ng-with-files-and-folders?view=powershell-7.4

https://superuser.com/questions/1808526/how-to-read-the-contents-of-a-file-using-powershell-script

The Get-Content cmdlet may be a good starting point. Not a cmdlet I have worked with (full disclosure) but may serve as a starting point to meet the stated merge, etc.. requirements.

Do some googling, read, then refine the search criteria as you read and learn.

Create a test environment to experiment in. Ensure that all original data is safely backed up and away from the test environment. If things go astray in the test environment simply delete all and try again.

Work out a step-by-step plan to show what you believe needs to be done from beginning to end. Does not need to be perfect the first time.

Objective simply being to get a sense of the overall merging requirements.
 

Cyber_Akuma

Distinguished
Oct 5, 2002
492
21
18,785
You can't just append the entire screenshot file to another, it has a structure, just putting the entire contents of one file into another would likely end up with a file that can't be parsed by Steam or even crash it.

For example, here is what the start of the file looks like:
View: https://i.imgur.com/SMmJzuo.png


The file starts with "screenshots" and this is not repeated, and then it lists a game ID (394230) and then lists details of each screenshot under it, including any comments as well as other details.

Here is another later in the file:
View: https://i.imgur.com/DlOXJWr.png


There are two game entries in that one (Game ID 1635840 and 737520), with the first one only containing a single screenshot, and the second one apparently having the game save the screenshots in two locations.

Just simply merging full files would be a mess since it would contain two entire sets of entries instead of one and likely would not get parsed properly as the entire file starts with "screenshots {" but for games where I took screenshots of the same game on two different computers the entries would also need to be under the same game ID and not as separate entries.

It's also not clear if the order the games themselves are listed in the file matters, it does not seem to just list the games in numerical order by their game IDs either.

This is why I was asking if anyone has made any tools to merge entries from the file into one, since you can't just copy-paste the entire contents of one file to another, and I don't know the details of what does and does not matter in terms of the order (if any) of what game entries go where.

The Steamworks documentation contains some information on it, but not enough to do this. It's intended for developers making their game work with Steam's screenshot API, not to explain how their file structure works in it's entirety.

https://partner.steamgames.com/doc/api/ISteamScreenshots