As part of a program, I have a configuration section that writes some values from the user into a config file.
This code writes to the file:
Code: Select all
set /p "Alias=Name/Nickname/Alias: "
set /p "RoomDir=Room Directory/Drive: "
set /p "Rate=Refresh Rate: "
set /p "choice=Save these settings? (Y/N): "
if /i not "%Choice%"=="Y" (
echo Changes aborted
ping localhost -n 2 -w 1000 >nul
goto mainmenu
)
echo Alias=%Alias%>batchat.ini
echo Rate=%Rate%>>batchat.ini
echo RoomDir=%RoomDir%>>batchat.ini
And this code reads the settings back into variables
Code: Select all
for /f "delims=" %%a in ('findstr /r /v /c:"^\[.*\]$" "batchat.ini"') do set "%%a"
Problem:
I'm pretty sure the first code snippet seems to be the problem. When I save the settings and open the config file, there's an entry for the alias and the roomdir but nothing for the rate.
Can anyone spot my mistake here?
Thanks,
Phillid