简体   繁体   English

如何使用bat文件响应命令行提示符(Windows)

[英]How to respond to command line prompt using bat file (Windows)

I am executing this in my .bat file via command line; 我正在通过命令行在.bat文件中执行此操作; inside of .bat is: .bat的内部是:

rmdir /S logs

Windows prompts: Windows提示:

logs, Are you sure (Y/N)?

I have always to type Y. How do I make this automatic? 我总是必须键入Y。如何使它自动执行? I always want to respond Y. 我一直想回应Y。

根据help rmdir ,可以添加参数/Q以避免确认查询。

try this -> 试试这个->

rmdir /S logs <y

or 要么

echo y | rmdir /S logs

or 要么

rmdir /S /Q logs

taken from the help 取自帮助

/Q Quiet mode, do not ask if ok to remove a directory tree with /S

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM