Kaseya Community

for/f syntax

  • Hi,

    i have a file with the name of the printer and its status

    xx\xx\xx\idle or resuming

    what would be the correct syntac-x ?

    for /f "tokens=1,2,3,4 delims=\" %d in ('printers.txt') DO @ECHO %b

  • Close...

    for /f "tokens=1,2,3,4 delims=\" %a in (printers.txt) DO ECHO %d

    You are allocating four variables with the "tokens" option. Then we need to declare the first variable as "%a" which means the fourth in the sequence is "%d". Make sense?



    [edited by: SMason at 10:20 AM (GMT -7) on May 29, 2013] File naming