xteenf wrote:Can you explain why the caret symbol is needed in your first example?
Is it the escape character?
Yes, it is. Some special characters need to be escaped, such as < > | etc.
could you parse the line into English for me? These dos for loops are completely foreign to anything I've seen before. If "delims=" is optional, what is its purpose here?
for /f "delims=" %a in ('dir d:\ /b /s ^| find /i "dcar"') do rmdir /s /q "%a"for /f... and "delims=" ensures that no delimiters are applied so the output from the command is not altered.
dir d:\ /b /s ^| find /i "dcar"
This performs a dir from the root of d: and returns brief information and recurses through subdirectories. It provides a list of files and folders with paths. Add /a:-d to filter out the folders, and only use the list of files. It pipes the list through find, searching for dcar in the long file/folder names and is case insensitive.
The output of that is used in the "%%a" token.