How to extract name/value pair from config file from DOS batch script?
Posted on 2008-02-08
I've been working on a DOS batch script that needs to get the name of a log file from a configuration file.
The config file is set up as a name/value pair file as follows:
Now I can find the right parts using this command:
> find "prog.varone" myconfigfile.cfg
the output of this looks somthing like this:
And I know I can extract only the second line of this output using something like this:
> for /F "skip=2 delims=" %%a in (%~fs1) do echo %%a
But I'm not sure how to tie it all together and strip off the left side of the "="... I would ultimately like to have this:
> echo The value of the configuration is: %workingvariable%
> The value of the configuration is: prog'svalue1