且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将EXE输出写入批处理文件

更新时间:2022-12-15 23:41:31

我假设您要捕获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