This command works locally:
for /f "tokens=2" %s in ('sc query state^=inactive ^| find /i "SERVICE_NAME: work"') do set service=%s
But doesn't work when I try running it on this computer from another computer:
wmic /node:"<station_name>" process call create "cmd.exe /c for /f "tokens=2" %s in ('sc query state^=inactive ^| find /i "SERVICE_NAME: work"') do set service=%s"
I'm getting the following error:
Invalid named parameter list.
Hint: <named param list> ::= <named param> | <named param> <named param list> where <named param> ::= <param name>=<param value>
I've managed to run simple commands, like:
wmic /node:"<station_name>" process call create "cmd.exe /c echo hi > c:\test\output.log"
How do I run the previous command with wmic?