views:

21

answers:

0

I am trying to throw a plink command to my esx server and grep the linux output of the command. The code above does not work. But if I remove the | grep part it works again. Is there any other way to achieve the same results but making the command passable with cmd.exe?

FOR /F "TOKENS=1 DELIMS=:" %%A IN ('TYPE %SYSTEMDRIVE%\Users\Ian\Desktop\backup.list') DO ECHO %%A & (FOR /F "TOKENS=2*" %%B IN ('%PLINK% -batch -ssh %USERNAME%@%ESXHOST% -pw %PASSWORD% vim-cmd vmsvc/get.datastores %%A | grep datastore') DO ECHO %%B)