I am writing a batch file for the Windows command prompt to delete all directories matching a certain expression.
I am first using DIR
to return a plain list of directories matching the expression. I would like to pipe each line of output into the RMDIR command, like this:
DIR *.delete /A:D /B /S | RMDIR /S /Q
However the above command doesn't seem to work. I don't fully understand why this doesn't work and would be grateful to anyone who can offer an explanation.