How come this keep replacing the variable with each data from the loop instead of appending it?
set ipList=
for /F %%i in (ips.txt) do ( set ipList=%ipLis%,%%i )
It's true you need delayed expansion. Another way:
setlocal ENABLEDELAYEDEXPANSION
set ipList=
for /F %%i in (ips.txt) do ( set ipList=!ipList!,%%i )
Note the '!' instead of '%%'. Also, there was a typo in your question, I suppose it should be %%ipList%% instead of %%ipLis%% (a 't' is lacking).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With