更新时间:2023-11-17 23:31:22
首先,更多|回声DOA | Program.exe文件
不会做你认为它。
发送的 DOA 的回声后
没有这些管道阶段连接在一起,它,而创造完美的水槽 - 这就是为什么你没有看到你的命令的响应。他们无处可去,而且不会按的Program.exe
执行。我不认为有一个简单的方法来实现您直接从命令行想要的东西,但它可以通过小批量的文件,可以轻松解决。创建一个批处理文件,说 args.bat
:
First, more | echo doA | program.exe
does not do what you think it does.
After sending doA echo
does not connect those pipe stages together, it rather creates perfect sink - that's why you do not see your commands echoed. They go nowhere and are not executed by program.exe
. I don't think there is a simple way to achieve what you want directly from command line, but it can be easily resolved by using small batch file. Create a batch file, say args.bat
:
@echo off
echo First command
more
现在通过运行程序 ARGS | Program.exe文件