Search found 2 matches

by droberts
04 Oct 2011 17:48
Forum: DOS Batch Forum
Topic: Any way to execute script within a variable?
Replies: 2
Views: 2836

Re: Any way to execute script within a variable?

Clarification, the bigger problem is that my input file has foo1=bar1, foo2=bar2, ... I want to read in that file such that I end up with variables %foo1% equal to 'bar1'. I can use a FOR loop to split each pair but then I need to keep track of %%i, %%j, %%k, ... I then @echo set %%i >> temp.bat cal...
by droberts
04 Oct 2011 16:58
Forum: DOS Batch Forum
Topic: Any way to execute script within a variable?
Replies: 2
Views: 2836

Any way to execute script within a variable?

Hi,
I'm reading from a file some name/value arguments (e.g. foo=bar) so that these are stored in say %%i, %%j.

I would like to just do

set %%i

echo %foo%

but it's not working. Is there a way to get the %%i to expand such that it can be used in the new set command?

Thanks