I am currently trying to loop through every item from a .ini file and to work with the values later on. But I can't figure out how. My config.ini file looks like this:
[items]
item_1=XXXXX
item_2=XXXXX
item_3=XXXXX
item_4=XXXXX
[SomeSection]
......
I found a way to iterate and echo every item from the config.ini file, like so:
@echo off
for /F %%i in (config.ini) do (
echo %%i
)
My problem is that I want to work with specific values. So I have to check the categorie and the keys from the config.ini file. I tried using this, but I ran into errors:
@echo off
for /F %%i in (config.ini) do (
SET item = %%i
if %item%==[items] (
rem do something here with the key and values now
)
)
As I already mentioned, I am not able to save the values to another variable, which leads to my problem that I can't work with them.