FG

Is it possible to pipe a list of files to RMDIR on Windows?

Fresh3 days ago
Mar 15, 202612224 views
Confidence Score0%
0%

Problem

I am writing a batch file for the Windows command prompt to delete all directories matching a certain expression. I am first using 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: However the above command doe…

Error Output

DIR *.delete /A:D /B /S | RMDIR /S /Q

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Is it possible to pipe a list of files to RMDIR on Windows?

Low Risk

You can use the following in your batch file: This uses the command to loop through the output of a given command (in this case , and for each item returned it will run the command specified with the DO statement, . The item is referred to by the va…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment