1.

Solve : Executable command line output into variable?

Answer»

Hi.
After looking around on the forum I have been unable to find an EFFICIENT WAY of getting a COMMAND line string returned from an executable, that is RUN within a batch file, into an environmental variable of the same batch file.
Can any one please provide me with a way of doing this?

THANKS in advance.



you use the for loop to get the executable string result. check for/? for more information
also , to set the environment variable, eg PATH, you use set.
eg
set PATH=%PATH%;%result%Thank you for that.
I found this below seems to do the job.

FOR /F %%A IN ('mycommand.exe') DO set myvar=%%A



Discussion

No Comment Found