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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -