@echo off
REM DEFINE THE HOSTS THAT SHOULD BE SKIPPED (SEPARATE WITH SPACE)
set DISCARD=DC1 DC2 MGW
FOR /F "delims= " %%a IN ('@echo %DISCARD%') DO @(
echo DISCARDED : %%a
)
but this only echoes the word before the first space.
C:\>skip.cmd DISCARDED : DC1 C:\>
I know that I could use a text file containing all the words separated with new lines, but for the sake of simplicity I want to define everything inside one variable. I understand that using the "tokens=" parameter I can capture the amount I want from the line, but I just want to echo every token from the line and do something with them.
This is what I would like the output to be:
C:\>skip.cmd DISCARDED : DC1 DISCARDED : DC2 DISCARDED : MGW C:\>
Is this possible?



Help
Back to top











