Jump to content

Batch file to change text in a txt file?

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Scarness

Scarness

    Newbie

  • Members
  • PipPip
  • 10 posts
Hello , I have agame called Borderlands and my father likes to play with god mode and I don't.
I found a ini file which enables god mode bu it takes too much time to find and and change it.
I know a bit of programming ( batch ) , and I would like to know how I can make a batch file to change "false" to "true" and vice versa by typing false or true.
Thanks in advance.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Have two backup copies of the file and use your batch file to overwrite the "real" one with the appropriate copy.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
I would not have even thought of that. Maybe

godmode.bat:
set location="C:\path\to\ini\file"
copy %location%\godmode.ini %location%\game.ini
nogodmode.bat:
set location="C:\path\to\ini\directory"
copy %location%\nogodmode.ini %location%\game.ini
And you could place the bats on your desktop or whatnot and have it copy it over each time. Do not quote on my syntax though.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Back when I played Populous a lot, I had a batch file called switch.bat that I used to switch it between "normal" and "expansion pack" modes.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users