1.

Solve : retrieving a result and passing as an argument?

Answer»

Hi,

Is it possible in a DOS command or batch FILE to retrieve a result from commandA and pass it as an argument to COMMANDB? (FIRST choice=not writing to an external file, SECOND choice=writing to an external file)

i.e. sample script pseudo-code

REM get result from PROGRAMA
SET MyEnvironmentVariable = programA

REM invoke programB and pass argument to it
programB %MyEnvironmentVariable


Thanks in advance.


If programA gives a line of text as output you can capture it with FOR and pass the result to program B. if there might be spaces use quotes

for /f "delims=" %%A in ('programA') do programB "%%A"



Discussion

No Comment Found