Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::WRITEN BY DUXA 8/14/2018
- ::WHAT NEEDS TO BE DONE
- :: 1 - Download 7zip CMD verson. Its the 3rd link down on 7zip downloads or use direct link
- :: https://www.7-zip.org/a/7z1805-extra.7z and place it either in C:\7z_console or elsewhere
- :: but if you place it elsewhere then you need to change the SZIPPATH path below
- :: Windows does not have compresion via CMD by default, and not using compression would be silly since 9MB file
- :: is compressed down to ~30kb. Thats 99.7% compression. 7zip was chosen because its free and very good.
- :: Note: If you already have 7zip you can change the path to point to it, but note non cmd version is 7z.exe not 7za.exe
- :: so you will need to adjust that on line 92.
- :: 2 - Copy/Pasta this whole thing into a text file and end it with .bat, for example "MonsterHunterBackup.bat"
- :: Edit paths below by replacing XXXXX with your steam user ID. Just follow the path to where the game is
- :: saved and you will see your ID as the name of the folder before you reach 582010 folder.
- :: No way for me to know what your ID is so you gotta do this yourself.
- :: NOTE: Non Windows 10 users change CHK=1 to be CHK=0 below. Non Win10 support is possible but I think most are on Win10
- :: 3 - OPTIONAL: you can make Windows Scheduler run this script at whatever interval you want, backup every
- :: 10 minutes? No problem, every hour? No problem. If CHK below is set to 1 it will only back up saves if
- :: there was an actual change to the file.
- :: I noticed save file changes upon loading and upon saving. Quitting without saving does not modify it.
- :: If you are not on Windows 10 you can not use this due to different formatting on previous Win versions.
- :: So if you are on Windows 7 you can still use the backup functionality, but you just have to set CHK to 0
- :: so it will backup every time you or scheduler runs it.
- :: By default the backups are saved as .7z files in BACKUPPATH path below (your user folder)
- :: You can change it by editing BACKUPPATH.
- :: Note that a log is kept, so that you can go back and see when backups were done. They will
- :: be in the same directory as the backups. Also two text files containing previous/current checksums are kept
- :: there too. They are simple txt files taking up 1kb in space. They are only created if CHK is set to 1.
- :: For any questions find me on Reddit /u/Chrushev
- @echo off
- :: CHANGE THESE AS NEEDED
- ::Location of the saves (replace XXXXX with your user ID)
- set PATH=C:\Program Files (x86)\Steam\userdata\102139856\582010\remote
- ::Location to save the file to. (replace XXXXX with your user ID)
- set BACKUPPATH=C:\Program Files (x86)\Steam\userdata\102139856
- ::Location of 7zip cmd version (can be obtained from https://www.7-zip.org/a/7z1805-extra.7z)
- set SZIPPATH=C:\7z_console
- ::Log path (by default uses the same path as the backups)
- set LOGPATH=%BACKUPPATH%
- ::FLAG to check only if save file changed, set to 0 if want to backup no matter what
- ::THIS ONLY WORKS ON WINDOWS 10 due to formatting! TURN OFF OTHERWISE BY SETTING TO 0
- set /a CHK=1
- ::DO NOT CHANGE ANYTHING UNDERNEATH UNLESS YOU KNOW WHAT YOU ARE DOING
- if exist "%SZIPPATH%" goto CHECKPATH
- color 0C
- echo ERROR!
- echo Cannot find 7-zip
- echo Download the cmd version from https://www.7-zip.org/download.html
- echo and place it in the path listed above.
- pause
- goto END
- :CHECKPATH
- if exist "%PATH%" goto RUN
- echo ERROR!
- echo Cannot find %PATH%
- pause
- goto END
- :RUN
- if not exist "%BACKUPPATH%\MHW_last_cksum.txt" goto BACKUP
- if %CHK% == 0 goto BACKUP
- "%SystemRoot%\system32\CertUtil" -hashfile "%PATH%\remote\SAVEDATA1000" MD5 > "%BACKUPPATH%\MHW_curr_cksum.txt"
- for /f "tokens=1*delims=:" %%G in ('%SystemRoot%\system32\findstr /n "^" "%BACKUPPATH%\MHW_last_cksum.txt"') do if %%G equ 2 (
- echo Previous: %%H
- set PREV=%%H)
- for /f "tokens=1*delims=:" %%G in ('%SystemRoot%\system32\findstr /n "^" "%BACKUPPATH%\MHW_curr_cksum.txt"') do if %%G equ 2 (
- echo Current: %%H
- set CURR=%%H)
- if "%PREV%" == "%CURR%" (
- echo Checksums match. New backup NOT needed.
- echo %date% %time% - Backup requested, file is same as last time. NOT backing up. >> "%LOGPATH%\MHW_saves_log.txt"
- echo If you would like to backup either way, please set CHK=0 in the script. >> "%LOGPATH%\MHW_saves_log.txt"
- goto END
- )
- :BACKUP
- if %CHK% == 1 "%SystemRoot%\system32\CertUtil" -hashfile "%PATH%\remote\SAVEDATA1000" MD5 > "%BACKUPPATH%\MHW_last_cksum.txt"
- set FILENAME=MHW_Save_%date:~4,2%-%date:~7,2%-%date:~10,4%_%time:~0,2%-%time:~3,2%-%time:~6,2%
- "%SZIPPATH%\7za.exe" a -y "%BACKUPPATH%\%FILENAME%" "%PATH%"
- if exist "%BACKUPPATH%\%FILENAME%.7z" echo Saved %FILENAME% >> "%LOGPATH%\MHW_saves_log.txt"
- :END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement