In cmd can I dir /s but only to n sub directories?
Question
In the Windows command shell, cmd
, is there a way to C:> dir /s
but only to n sub directories?
Seems to me that I have made this work in the past, though I may have corrupted that sector in my brain with certain cell damaging liquids... :P
I guess I could redirect the output into a log and then skim it with findstr or qgerp but it seems like there should be a cleaner way.
La solution
"Cleaner way"? With DOS commands like "dir"? You've got a dry sense of humor, there ;)
You can do a "dos /?" to query available options. "limit recursion to 'n' directores with /s" is definitely not one of them.
If you want to do that, you'd need to write your own program ... or redirect to a text file and parse the file.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow