@echo off :: This batch file copies Mad Max savegames and setting files from Steam's savegame location to WB Games :: backup location. Script corrects the issue where the files in backup location have been replaced by 0kb :: versions when exiting the game. Script assumes all file locations are on C drive. :: :: Related blog post: https://www.welou.net/blog/2019/09/28/mad-max-and-the-lost-saves/ :: :: Configuration. Fill in the file locations on your system (without trailing backslashes). :: :: Mad Max Steam savegame location (an example path provided, confirm the directory and fill in your Steam :: User ID and Steam Game ID). set steamBackups=C:\Program Files (x86)\Steam\userdata\STEAM_USER_ID\STEAM_GAME_ID\remote :: WB Games Backup savegame location (an example path provided, confirm the directory). set wbBackups=C:\Users\WINDOWS_USERNAME\Documents\WB Games\Mad Max\Backup Saves :: Your backup savegame location (by default the "Saved Games" directory in user's home folder), leave :: empty for no backups. A backup is created every time this program is run in case the files might really :: be corrupted and you need to get an earlier version back. set myBackups=C:\Users\WINDOWS_USERNAME\Saved Games\Mad Max :: :: Program :: echo Mad Max Uncorrupter v.1.0 echo. echo Overriding WB Games Backup files with versions from Steam... xcopy /s /y "%steamBackups%\*.*" "%wbBackups%" echo. :: skip backups creation if no path given if "%myBackups%"=="" goto end :: create backup location if it does not exist if not exist "%myBackups%" md "%myBackups%" :: switch to backups location :: update this if backups are not on C (for example for D drive: cd \D %myBackups%) cd %myBackups% :: determine new folder name: backup_2, backup_3, etc. setlocal enableDelayedExpansion set "baseName=backup_" set "n=0" for /f "delims=" %%F in ( '2^>nul dir /b /ad "%baseName%*."^|findstr /xri "%baseName%[0-9]*"' ) do ( set "name=%%F" set "name=!name:*%baseName%=!" if !name! gtr !n! set "n=!name!" ) set /a n+=1 :: create directory md "%baseName%%n%" :: make the backup echo Backing up current version of Steam files into "%myBackups%\%baseName%%n%"... xcopy /s /y "%steamBackups%\*.*" "%baseName%%n%" echo. :: wait for user input before closing :end pause exit