I have two files
The first is batch.ini and the second is batch.bat
I would like the string retrieved by the bat in the ini file display the variables defined in bat file.
With the following code, it does not work.
The string of characters retrieved does not display the variables defined in the bat file.
echo %csvchoice% --> %var1%;%var2%;%var3%
I am looking for the following result:
echo %csvchoice% --> James;Jayce;John
Thanks for your help
Batch.ini file:
Code: Select all
csvchoice=%var1%;%var2%;%var3%
Code: Select all
set var1=James
set var2=Jayce
set var3=John
Define.Csvchoice.Ini
for /F "tokens=* delims= " %%f in ('findstr /R /C:"csvchoice=" batch.ini') do (
set csvchoice_ini=%%f
goto :End.Csvchoice.Ini
)
:End.Csvchoice.Ini
set csvchoice=%csvchoice_ini:~10%
echo Variable in batch.bat : %var1%;%var2%;%var3%
echo Variable in batch.ini : %csvchoice%
pause