windows - Batch-file get return Value from exe -
windows - Batch-file get return Value from exe -
i wrote simple c-program dow.exe, homecoming value day of week. need batchfile, how can this, how can homecoming value ?
dow.exe: tu
my batchfile: //doesn't work
set day = dow.exe
echo = %day%
if, seems, dow.exe
file echoes console (stdout program) day of week text, then:
from command line
for /f %a in ('dow.exe') set "dow=%a"
for usage within batch file, percent signs need escaped
for /f %%a in ('dow.exe') set "dow=%%a"
what execute indicated command, retrieve output , each line in it, execute code after do
clause, line retrieved stored within for
replaceable parameter (%%a
in case)
windows batch-file return return-value
Comments
Post a Comment