如何在bat文件中自动插入值 [英] How to insert automatically value in bat file
本文介绍了如何在bat文件中自动插入值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要备份脚本,但是执行后执行的程序要求Y或N继续. 如何编写脚本以自动插入Y.
I need a backup script but the executed program after executing asks Y or N for continuing. How to write a script to automatically insert Y.
例如,程序的行为是这样的 c:\ tool \ backup.exe -b 继续Y,N?
for example the program acts like this c:\tool\backup.exe -b Continue Y, N?
现在我需要创建一个蝙蝠脚本,但是如何自动插入Y?
now I would need that I create a bat script, but how to insert Y automatically?
推荐答案
如果该程序没有关闭交互行为的开关,则可以使用
If the program doesn't have a switch to turn off interactive behavior, you can use
echo Y | someprogram.exe
,它将看起来像某个程序,就像用户已经输入了Y
.
which will look to someprogram as if the user would have entered Y
.
这篇关于如何在bat文件中自动插入值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文