below is the line I just can't seem to get to work.
Code: Select all
FOR /F "tokens=2" %%A in (C:\output.txt) do (IF "%%A" == "-dns" (SET write=false)
IF "%%A" == "Network" (SET write=false)
IF "%%A" == "Directory" (SET write=false)
IF "%%A" == "NODE" (SET write=false)
IF "%%A" == "Manager" (SET write=false) ELSE (SET write=true)
IF "%write%" == "true" echo %%A >> C:\nodes.txt)
I have also tried something like an OR but it wouldn't work either.
Code: Select all
FOR /F "tokens=2" %%A in (C:\output.txt) do (IF NOT "%%A" == "-dns" OR NOT "%%A" == "Network" OR NOT "%%A" == "Directory" OR Not "%%A" == "NODE" OR NOT "%%A" == "Manager" echo %%A >> C:\nodes.txt)
Basically I am trying to output a list of server nodes that I can ping in a later step of the CMD file, and the Server names will most likely be different for every place I run this with so I don't know exactly what they will be.