I need to find a way to automate the settings of a configuration file. The file basically looks like this:
value1=hello
value2=world
value3=cookies
value4=cream
Ideally I would like to run a .bat file, with something like the following parameters:
setconfiguration.bat filename -value3 test -value4 success
This would then change the file data to the following:
value1=hello
value2=world
value3=test
value4=success
Is there any easy way of doing this without having to install any new tools? Honestly I have little experience with scripting (.bat) and Google has not been very helpful so far. :(
EDIT: I found a script called repl.bat on this answer; https://stackoverflow.com/a/16735079/4121213 Using this I can do something like which replaces a single value. This should be able to help me out further.
@echo off
setlocal
cd /d %~dp0
Set "OldString=^value3=\S{1,100}"
Set "NewString=value3=test"
set file="test.txt"
for %%F in (%file%) do set outFile="%%~nFCleaned%%~xF"
pause
call repl OldString NewString e <%file% > %outfile%
Thanks,