I'm trying to change a value in an ini file to an argument in the batch command. I have this working for a file in the same directory as the batch file, but I have hundreds of folders that I need to do this for. How can I adapt the script below to iterate through the folders in the path this file is run from?
Code: Select all
@echo off
rem to change Clone Hero Charter (in song.ini files)
setlocal EnableDelayedExpansion
rename song.ini song_org.ini
rem Define new values of desired variables - note if you need more than 5 add %x to the line below
set newValue[charter]=%1 %2 %3 %4 %5
(for /F "tokens=1,2 delims==" %%a in (song_org.ini) do (
set "value=%%b"
if defined newValue[%%a] set value=!newValue[%%a]!
echo %%a=!value!
)) > song.ini