Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

No more losing hours of gameplay due to corrupt save file


Play_GTASA
 Share

Recommended Posts

I was messing with mods and somehow corrupted my saved game file.

 

I thought hmmmm what if there was a way to have the saved game file backed up every 5 minutes while the game runs.

 

I created a solution!

 

Simply copy the below code into a new text file, call it anything you want ".bat" and put it in your game folder next to gta_sa.exe.

 

Then make a shortcut to that .bat file on your desktop (or wherever you usually run the game from) and change the icon in the properties to the game icon just so it looks proper.

 

Now when you run the game from that shortcut, your saved game file will be backed up to a folder with the current date and time, every 5 minutes.

 

The command window stays minimized the whole time. When you quit out of the game, you can either leave the (minimized) command window running, it will backup your very latest saved game, then it will close itself in less than 5 minutes. Alternatively you can click the minimized command window in your system tray to maximize it, then hit any key and it will backup your current saved game, then exit the command window.

 

There's more info in the below code itself, enjoy!

 

If it doesn't work for you, let me know and I will try to update the commands.

 

Only tested on Windows 10 x64.

 

if not DEFINED IS_MINIMIZED set IS_MINIMIZED=1 && start "" /min "%~dpnx0" %* && exit

:: ===================================================================================================
::
:: This batch file runs to ensure that if you end up with a corrupt save game file that will not
:: load, you can always revert back to a very recent saved game without losing all your gameplay.
:: A corrupt save file can happen for a number of reasons including when testing out mods.
::
:: When running this, it uses the "-skip" command that skips the game intro,
:: taking you straight to the "START GAME / OPTIONS / QUIT GAME" screen.
:: If you don't want to skip the intro, simply remove "-skip" from the line
:: below that runs gta_sa.exe.
::
:: After running this, saved game backups will be located in their own folders with date and time,
:: in your GTA San Andreas saved game folder in your Windows user profile "Documents" folder, here:
::
:: "C:\Users\<CURRENT USER>\Documents\GTA San Andreas User Files\"
::
:: There, you'll see the saved game backup folder with a date and time like this:
:: "YYYY-MM-DD at HHMM - GTA San Andreas Saved Game"
::
:: Your saved game file will be backed up every five minutes while the game is running.
:: When you exit the game, click this command window and hit any key to exit it, your
:: last saved game will be backed up. You can leave this command window running and it
:: will close itself within 5 minutes of exiting the game.
::
:: To make sure the date and time work properly, there's a US and UK version
:: below - it's set to UK by default.
::
:: If you are in the US, simply put a double colon with a space after it like this :: 
:: before the two lines starting with [For /f "tokens] under the UK version and then
:: take the double colons away from the two lines starting with [For /f "tokens]
:: that are under the US version. This lets you use either one (US or UK).
::
::
:: ===================================================================================================

title GTASA

:: Run the game...
start gta_sa.exe -skip

:: Wait 3 seconds for game process to start...
timeout 3

:CHECK_PROCESS
tasklist /FI "IMAGENAME eq gta_sa.exe" | find /I "gta_sa.exe"
IF ERRORLEVEL 2 goto BACKUP_SAVE_FILE
IF ERRORLEVEL 1 goto FINISHED

:BACKUP_SAVE_FILE
:: This will backup the save game file every 5 minutes (301 seconds).
:: You can set the figure here to a shorter or longer period if desired.
timeout 301
::
:: ==============================================================================
:: United States version:
:: For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set the_date=%%c-%%a-%%b)
:: For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set the_time=%%a%%b)
:: ==============================================================================
:: United Kingdom version:
For /f "tokens=1-3 delims=/ " %%a in ('date /t') do (set the_date=%%c-%%b-%%a)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set the_time=%%a%%b)
:: ==============================================================================
::
:: Copy the save game file to a new folder with date and time...
md "%USERPROFILE%\Documents\GTA San Andreas User Files\%the_date% at %the_time% - GTA San Andreas Saved Game"
xcopy "%USERPROFILE%\Documents\GTA San Andreas User Files\GTASAsf*.*" "%USERPROFILE%\Documents\GTA San Andreas User Files\%the_date% at %the_time% - GTA San Andreas Saved Game" /i /r /v /k /f /c /h /y
goto CHECK_PROCESS

:FINISHED
exit

 

 

Edited by Play_GTASA
Updating command script
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.