|
|
#1 |
|
Banned
Join Date: Oct 2007
Reputation: 55
Posts: 720
|
Borderlands Character & Config Backup Tool
Original Idea Here:
http://gbxforums.gearboxsoftware.com...ad.php?t=80930 This creates backups of your characters and game configs and then launches the game. I've added auto detection for the steam directory, and it backs up both characters and game configs. If someone can give me a dump of their retail borderlands registry key (export registry key) then I'll make a retail compatible version Copy this into a text file and rename to .bat, if you don't know how just use the download link below. Code:
:: By Dragonshadow, Original Idea By adrian783
:: Credit start %STEAMPATH% change to riedochs
@ECHO OFF
FOR /F "tokens=2*" %%A IN ('reg query "HKCU\Software\Valve\Steam" /v SteamPath') DO SET STEAMPATH=%%B
IF (%STEAMPATH%)==() GOTO ERROR
:Backup
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v
set t=%TIME%
if "%t:~1,1%"==":" set t=0%t%
set timestr=%d:~6,4%_%d:~0,2%_%d:~3,2%-%t:~0,2%%t:~3,2%
cd "%USERPROFILE%\My Documents\My Games\Borderlands\backup"
MD SaveData
cd SaveData
xcopy "%USERPROFILE%\My Documents\My Games\Borderlands\SaveData" /e
cd ..
MD WillowGame
cd WillowGame
ECHO \ScreenShots\ > temp_%timestr%.txt
xcopy "%USERPROFILE%\My Documents\My Games\Borderlands\WillowGame" /e /EXCLUDE:temp_%timestr%.txt
del temp_%timestr%.txt /Q
cd ..
rename SaveData SaveData_%timestr%
rename WillowGame WillowGame_%timestr%
start "Steam" %STEAMPATH%\steam.exe -applaunch 8980
exit
:ERROR
ECHO STEAM NOT FOUND
pause
Update2: Fixed typo and better borderlands launching method (thanks riedochs) Update3: Fixed the fixed typo, redid folder dating (Now uses military time), removed duplicate code Update4: Now supports paths with spaces (Biiiig oversight) Last edited by Dragonshadow: 08-30-2010 at 04:23 PM. |
|
|
|
|
|
#2 |
![]() Join Date: Aug 2008
Reputation: 14
Posts: 679
|
ah, yah i didnt really bothered with config files since they can be rebulid from the default just by deleting them, the save however is fubar.
i didnt do much, i stole the timestring parsing part from some code found on google, tho later i realized that the timestring is in 12hr format and it could be confusing if not in 24hr format, so thats something u can further fix. |
|
|
|
|
|
#3 |
![]() Join Date: Aug 2008
Reputation: 89
Posts: 962
|
Ohh, very nice!
|
|
|
|
|
|
#4 |
|
Guest
Posts: n/a
|
Why don't you just go into the saved games file and make a backup by hand? I do it all the time to transfer between computers
|
|
|
|
#5 |
![]() Join Date: Aug 2008
Reputation: 89
Posts: 962
|
The nice part is though, it lets you automatically back things up. It's quite useful.
|
|
|
|
|
|
#6 | |
|
Guest
Posts: n/a
|
Quote:
And the point of this is to back stuff up in case something goes wrong (which the game is apparently somewhat vulnerable to at the moment). |
|
|
|
|
#7 |
![]() Join Date: Feb 2009
Reputation: 3
Posts: 261
|
Awesome! thanks for making it in a zip, too. i keep getting an error though... It tells me that "Windows cannot find 'steam.exe'. Make sure I typed the name correctly, and try again." Yeah. not sure why. It gets everything else. I'm still learning to code, but if i'm interpreting it correctly, its trying to launch steam once it finishes? just trying to understand what is not happening. thanks again.
|
|
|
|
|
|
#8 | |
|
Banned
Join Date: Oct 2007
Reputation: 55
Posts: 720
|
Quote:
|
|
|
|
|
|
|
#9 |
|
Guest
Posts: n/a
|
sweet, now I can format and just keep the backup folder
|
|
|
|
#10 | |
![]() Join Date: Jan 2010
Reputation: 716
Posts: 3,738
|
Quote:
Why don't I do the math in my head and just imagine all these games to exist instead of playing them on a computer? ![]() The sincere answer is: the same primary reasons you automate any task: speed and accuracy. |
|
|
|
|
|
|
#11 | |
|
Guest
Posts: n/a
|
Quote:
EDIT: Im debugged the script and now it works for me: Code:
:: By Dragonshadow, Original Idea By adrian783
@ECHO OFF
FOR /F "tokens=3" %%A IN ('reg query "HKCU\Software\Valve\Steam" /v SteamPath') DO SET STEAMPATH=%%A
IF (%STEAMPATH%)==() GOTO ERROR
:Backup
for /f "tokens=1,2" %%v in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set timestr=%d:~6,4%%d:~0,2%%d:~3,2%_%t:~0,2%%t:~3,2%
cd "%USERPROFILE%\My Documents\My Games\Borderlands\backup"
MD SaveData
cd SaveData
xcopy "%USERPROFILE%\My Documents\My Games\Borderlands\SaveData" /e
cd ..
MD WillowGame
cd WillowGame
ECHO \ScreenShots\ > temp_%timestr%.txt
xcopy "%USERPROFILE%\My Documents\My Games\Borderlands\WillowGame" /e /EXCLUDE:temp_%timestr%.txt
del temp_%timestr%.txt /Q
cd ..
for /f "tokens=1,2" %%v in ('date /t') do set d=%%v
for /f "tokens=1" %%u in ('time /t') do set t=%%u
if "%t:~1,1%"==":" set t=0%t%
set timestr=%d:~6,4%%d:~0,2%%d:~3,2%_%t:~0,2%%t:~3,2%
rename SaveData SaveData_%timestr%
rename WillowGame WillowGame_%timestr%
start %STEAMPATH%\steam.exe -applaunch 8980
exit
:ERROR
ECHO STEAM NOT FOUND
pause
for /f "tokens=1,2" %%u in ('date /t') do set d=%%v replaced by for /f "tokens=1,2" %%v in ('date /t') do set d=%%v lookes like that some variables mixed up. 2. Change: Code:
cd %STEAMPATH% start steam.exe -applaunch 8980 Code:
start %STEAMPATH%\steam.exe -applaunch 8980 Last edited by riedochs: 04-08-2010 at 11:04 PM. |
|
|
|
|
#12 |
![]() Join Date: Feb 2007
Reputation: 362
Posts: 3,814
|
For loops, if statements, and variables... this is the Mozart of batch files. Dragonshadow, you get the most well deserved +rep I've ever given anyone.
|
|
|
|
|
|
#13 | |||
|
Banned
Join Date: Oct 2007
Reputation: 55
Posts: 720
|
Quote:
Quote:
Edit: Nah, that %%u gobbles up the first part of the date so only the mm/dd/yyyy gets to the var Quote:
Last edited by Dragonshadow: 04-26-2010 at 11:08 AM. |
|||
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|