将EXE输出写入批处理文件 [英] Writing an EXE output to a batch file

查看:115
本文介绍了将EXE输出写入批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个EXE,输出值将为0/1. EXE将通过批处理文件进行调用.我希望批处理文件运行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.

推荐答案

我假设您要捕获EXE的输出并处理该值,而不仅仅是打印该值.您可以通过以下方法捕获变量中的输出:

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 

这篇关于将EXE输出写入批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆