Changing values in config files with a bat file
Posted on 2008-10-24
I have written a bat file that will change some config settings for me on another file on the machine.
I found a useful tool called change.com from googling the net which allows me to do this but it is limited in that it has no wildcard function and the value I am changing is a variable between 0 and 255 with 2 channels so I end up with an extremely large file which does work but I'm wondering if there is a better way to do this? The change function changes the first value to the second ONLY if the first function matches one in the program.
change FolderA\settings.ini "left=255" "left=0"
change FolderA\settings.ini "left=254" "left=0"
etc all the way down to left=1 then I have another for right=255 down to right=0
I also don't know how to do this if the bat files are located in a sub folder to the one I want to change - do they have to be in a folder above the one you want to change? It also wouldn't work if the bat files were inside their own folder even if senior - I'm guessing this is my limited knowledge of file paths etc.
Any input from you more senior programmers would be appreciated :D