3

How can I search for all directories/folders which contain the character ;.

From this question I see I can search for any other character using, e.g. to find all directories containing a

dir /S *a* /AD

However, ; acts as a delimiter, so doing *;* is telling it to find * or *, i.e. Anything or anything, and returning every subdirectory rather than just those containing ;.

This would be great if I wanted to find, e.g. x or y as I could *x*;*y*, but how do I match ;?

Paul S.
  • 143

1 Answers1

6

You should quote the pattern:

dir /s /ad "*;*"

This way DIR will treat *;* as a single token. This is also useful for other special characters, like space, comma, caret (^), etc.

efotinis
  • 4,242