Batch Scripting — Creating variables based on input?

Echo off setlocal EnableDelayedExpansion SET hosts=10.10.0.0 192.168.0.0 W2K3-Server SET /a counter=0 FOR %%I IN (%hosts%) DO ( SET /a counter+=1 IF! Host%%I! == SET host!

Counter! =%%I ) echo Total=! Counter!

FOR /L %%A IN (1,1,! Counter!) DO ( echo host%%A=! Host%%A!

) endlocal.

Awesome this works. Thanks! – QA Automator Mar 10 at 17:51.

Try this @echo off setlocal EnableDelayedExpansion SET hosts=10.10.0.0 192.168.0.0 W2K3-Server SET /a counter=0 FOR %%I IN (%hosts%) DO ( SET /a counter+=1 set host! Counter! =%%I ) echo Total=!

Counter! FOR /L %%A IN (1,1,! Counter!) DO ( echo host%%A =!

Host%%A! ) endlocal.

This answer was posted around the same time as George's answer and is pretty close to the same code. Thanks for the time spent to help! – QA Automator Mar 10 at 17:55.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions