Prepend to stdin

人盡茶涼 提交于 2019-12-06 09:56:45

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

Now run your program by args|program.exe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!