How to respond to command line prompt using bat file (Windows)
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
精彩评论