【发布时间】:2015-10-08 11:53:21
【问题描述】:
我知道在批处理脚本中运行 EXE 时的正常行为是批处理脚本在继续之前等待 EXE 退出,但是有没有办法让批处理脚本继续执行,但将其 stdout 重定向到EXE 的标准输入?
基本上我正在尝试实现这个巧妙的技巧或类似的东西......
@ECHO OFF
echo This is a windows batch script...
dir /p C:\
C:\cygwin\bash.exe <--- Do some magic here
echo This is a bash shell script...
ls -la /cygdrive/c/
exit
echo We're back to the windows batch script again
REM Note: being able to return to the batch script isn't important
关于如何实现这一目标的任何想法?谢谢。
【问题讨论】:
标签: windows batch-file pipe