开发者

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

开发者 https://www.devze.com 2023-04-11 23:52 出处:网络
I am executing this in my .bat file via command line; inside of .bat is: rmdir /S logs Windows prompts:

I am executing this in my .bat file via command line; inside of .bat is:

rmdir /S logs

Windows prompts:

logs, Are you sure (Y/N)?

I have always to type Y. How do I make this automatic开发者_运维技巧? I always want to respond Y.


According to help rmdir you can add the parameter /Q to avoid the confirmation query.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号