Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing an EXE output to a batch file

Tags:

batch-file

exe

I have an EXE which will have the Output values as 0/1. The EXE is to be called via a batch file. I want the Batch file to run the EXE and write the output obtained. How is this possible? Any help would be appreciated.

like image 421
Sujeet Avatar asked Dec 16 '25 16:12

Sujeet


1 Answers

I asume that you want to capture the output of the EXE and process that value, instead of just printing that value. Here is how you can capture the output in a variable:

FOR /F "tokens=*" %%i IN ('%~dp0sometool.exe') DO SET TOOLOUTPUT=%%i 
like image 160
Lesmana Avatar answered Dec 19 '25 07:12

Lesmana



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!