문제

I have execution file (print.exe) which will print some numbers.I want to use those numbers. For that I wrote a batch file.

build.bat

set a=print.exe

FOR %I IN a DO prompt.exe %I%

I used the above 2 lines. But its not working. If, it is kernel command, the first line is working. For exe, it didn't work. How can i store the print.exe file output to variable.?

도움이 되었습니까?

해결책

The Batch file below execute print.exe and get its output in numbers variable:

@echo off

for /F "delims=" %%a in ('print.exe') do set numbers=%%a

echo Output of print.exe is: %numbers%
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top