Go Back   Steam Users' Forums > Steam Game Discussions > # - C > Borderlands

Reply
 
Thread Tools Display Modes
Old 10-30-2009, 07:07 PM   #1
Dragonshadow
 
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
Update: Now excludes screenshots from backup.
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.
Dragonshadow is offline  
Reply With Quote
Old 10-31-2009, 12:59 AM   #2
adrian783
 
 
 
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.
adrian783 is offline   Reply With Quote
Old 10-31-2009, 07:07 PM   #3
uber_hobo
 
 
 
Join Date: Aug 2008
Reputation: 89
Posts: 962
Ohh, very nice!
uber_hobo is offline   Reply With Quote
Old 10-31-2009, 07:23 PM   #4
R3tix
 
 
 
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
  Reply With Quote
Old 10-31-2009, 07:29 PM   #5
uber_hobo
 
 
 
Join Date: Aug 2008
Reputation: 89
Posts: 962
The nice part is though, it lets you automatically back things up. It's quite useful.
uber_hobo is offline   Reply With Quote
Old 10-31-2009, 09:58 PM   #6
Camtech
 
 
 
Guest
Posts: n/a
Quote:
Originally Posted by R3tix View Post
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
I think double clicking one file and having everything backed up whenever you want is a lot easier than manually copying all your important files.
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).
  Reply With Quote
Old 10-31-2009, 10:31 PM   #7
Mr Xombie
 
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.
Mr Xombie is offline   Reply With Quote
Old 11-03-2009, 02:05 PM   #8
Dragonshadow
 
Banned
Join Date: Oct 2007
Reputation: 55
Posts: 720
Quote:
Originally Posted by Mr Xombie View Post
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.
Its trying to tell steam run with with a parameter which is telling steam to launch borderlands... if it can't find steam then it can't find your registry key, which kind've confuses me because steam makes it registry keys when it runs.
Dragonshadow is offline   Reply With Quote
Old 11-03-2009, 09:31 PM   #9
homocow
 
 
 
Guest
Posts: n/a
sweet, now I can format and just keep the backup folder
  Reply With Quote
Old 04-08-2010, 03:27 PM   #10
Friendliest
 
Join Date: Jan 2010
Reputation: 716
Posts: 3,738
Quote:
Originally Posted by R3tix View Post
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
This msg is bait, right?

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.
Friendliest is offline   Reply With Quote
Old 04-08-2010, 10:43 PM   #11
riedochs
 
 
 
Guest
Posts: n/a
Quote:
Originally Posted by Dragonshadow View Post
Its trying to tell steam run with with a parameter which is telling steam to launch borderlands... if it can't find steam then it can't find your registry key, which kind've confuses me because steam makes it registry keys when it runs.
I have the same Problem here. Windows 7 says that Steam.exe can not be found. It makes no difference to run it as Administrator.

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
1. Change:
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
replaced by
Code:
start %STEAMPATH%\steam.exe -applaunch 8980
On my system, steam is installaed on a different drive and the 'cd' command dont change the drive. Now i start steam with the complete path and it works.

Last edited by riedochs: 04-08-2010 at 11:04 PM.
  Reply With Quote
Old 04-09-2010, 06:51 AM   #12
spyrochaete
 
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.
spyrochaete is offline   Reply With Quote
Old 04-26-2010, 09:16 AM   #13
Dragonshadow
 
Banned
Join Date: Oct 2007
Reputation: 55
Posts: 720
Quote:
Originally Posted by spyrochaete View Post
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.
Hahahahaha why thank you, I'd honestly thought this had died.

Quote:
Originally Posted by riedochs View Post
1. Change:
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.
Typo probably
Edit: Nah, that %%u gobbles up the first part of the date so only the mm/dd/yyyy gets to the var

Quote:
Originally Posted by riedochs View Post

2. Change:
Code:
cd %STEAMPATH%

start steam.exe -applaunch 8980
replaced by
Code:
start %STEAMPATH%\steam.exe -applaunch 8980
On my system, steam is installaed on a different drive and the 'cd' command dont change the drive. Now i start steam with the complete path and it works.
Thats actually not a bad idea, I'm adding this change, thanks.

Last edited by Dragonshadow: 04-26-2010 at 11:08 AM.
Dragonshadow is offline   Reply With Quote
Reply

Go Back   Steam Users' Forums > Steam Game Discussions > # - C > Borderlands


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -7. The time now is 02:46 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site Content Copyright Valve Corporation 1998-2012, All Rights Reserved.