Inspired by EpicLegend1337's Tool for backing up and restoring save games, I decided to clean up and post the batch file I use to regularly back up my savegames and profile.
Used with the Windows Task Scheduler, this will back up your BL2 save directory to some other directory that is named with a date (eg; D:\Backup\2012-11-27). It can be used multiple time a day, and will create a new directory every time (eg; 2012-11-27_2 or _3 or _4, up to 9 times).
In order to use this, you will need to
1. Create the batch file
2. Edit two lines
3. Add it to Task Scheduler
1. Create the batch file
Copy the text below, from "@echo off" to the end.
Open Notepad, and paste the text
Click on File... Save As... and give it a name. I'd suggest something like C:\Users\YourName\BackupBL2.bat - but change YourName to whatever the correct directory name is.
2. Edit Two Lines
Change the two lines to fit your situation.
set sourcedir=C:\Users\YourName\Documents\My Games\Borderlands 2\WillowGame\SaveData
set destbase=C:\Users\YourName\BL2_Backups
Chances are good that they just need "YourName" changed to whatever the correct directory name is, just like you did when saving the batch file in the previous step. Don't forget to save it again.
Test it. Go to an MS-DOS prompt and run "C:\Users\YourName\BackupBL2.bat". Do not double-click on it in Explorer because you won't see the output. Run it from a DOS prompt.
You should see something like:
If you got that, move on. If by some wild chance you got any errors, fix them and try again.
3. Add to Task Scheduler
Add it to the Task Scheduler... This site does a better job than I can of explaining it:
http://www.7tutorials.com/how-create...ic-task-wizard
If you leave your computer on all the time, choose Daily and set it for some time when you're always sleeping, like 6:00 AM or something. Otherwise, choose to run the Task "When I log on"
Set the "Program/script" to the batch file you created, C:\Users\YourName\BackupBL2.bat
The batch file itself is below. Copy this text and paste it to the file C:\Users\YourName\BackupBL2.bat
Used with the Windows Task Scheduler, this will back up your BL2 save directory to some other directory that is named with a date (eg; D:\Backup\2012-11-27). It can be used multiple time a day, and will create a new directory every time (eg; 2012-11-27_2 or _3 or _4, up to 9 times).
In order to use this, you will need to
1. Create the batch file
2. Edit two lines
3. Add it to Task Scheduler
1. Create the batch file
Copy the text below, from "@echo off" to the end.
Open Notepad, and paste the text
Click on File... Save As... and give it a name. I'd suggest something like C:\Users\YourName\BackupBL2.bat - but change YourName to whatever the correct directory name is.
2. Edit Two Lines
Change the two lines to fit your situation.
set sourcedir=C:\Users\YourName\Documents\My Games\Borderlands 2\WillowGame\SaveData
set destbase=C:\Users\YourName\BL2_Backups
Chances are good that they just need "YourName" changed to whatever the correct directory name is, just like you did when saving the batch file in the previous step. Don't forget to save it again.
Test it. Go to an MS-DOS prompt and run "C:\Users\YourName\BackupBL2.bat". Do not double-click on it in Explorer because you won't see the output. Run it from a DOS prompt.
You should see something like:
Code:
C:\Users\scott\Documents\My Games\Borderlands 2\WillowGame\SaveData\76561198072154098\profile.bin
C:\Users\scott\Documents\My Games\Borderlands 2\WillowGame\SaveData\76561198072154098\Save0001.sav
2 File(s) copied
Backed up to C:\Users\YourName\BL2_Backups\2012-11-27
3. Add to Task Scheduler
Add it to the Task Scheduler... This site does a better job than I can of explaining it:
http://www.7tutorials.com/how-create...ic-task-wizard
If you leave your computer on all the time, choose Daily and set it for some time when you're always sleeping, like 6:00 AM or something. Otherwise, choose to run the Task "When I log on"
Set the "Program/script" to the batch file you created, C:\Users\YourName\BackupBL2.bat
The batch file itself is below. Copy this text and paste it to the file C:\Users\YourName\BackupBL2.bat
Code:
@echo off
REM === EDIT THESE TO YOUR PATHS - do not use quotes! ===
set sourcedir=C:\Users\YourName\Documents\My Games\Borderlands 2\WillowGame\SaveData
set destbase=C:\Users\YourName\BL2_Backups
REM ======== DO NOT EDIT BELOW ========
echo.
FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
SET date=%yyyy%-%mm%-%dd%
if not exist "%sourcedir%" goto nosource
if not exist "%destbase%" md "%destbase%"
if not exist "%destbase%" goto nodestbase
set destdir=%destbase%\%date%
if exist "%destdir%" set destdir=%destbase%\%date%_2
if exist "%destdir%" set destdir=%destbase%\%date%_3
if exist "%destdir%" set destdir=%destbase%\%date%_4
if exist "%destdir%" set destdir=%destbase%\%date%_5
if exist "%destdir%" set destdir=%destbase%\%date%_6
if exist "%destdir%" set destdir=%destbase%\%date%_7
if exist "%destdir%" set destdir=%destbase%\%date%_8
if exist "%destdir%" set destdir=%destbase%\%date%_9
md "%destdir%"
xcopy "%sourcedir%\*" "%destdir%\" /s /e /c /y /i
echo.
echo Backed up to %destdir%
echo.
goto end
:nosource
echo.
echo ERROR: Source Directory does not exist!
echo.
echo Configured source directory is:
echo %sourcedir%
echo.
goto end
:nodestbase
echo.
echo ERROR: Destination Directory does not exist!
echo.
echo Configured source directory is:
echo %destdir%
echo.
goto end
:end