I am trying to figure out how many sub-folders contain a folder called "img", so I want to implement a recursive count of all subfolders called "img", if this is possible.
Also, how can I do a count that is one level deep? i.e it will look only one folder deep for all folders called "img"?
So, if my folder structure was :
>folder1
>img
>folder2
>subfolder
>img
>folder3
>subfolder
>subsubfolder
>img
>folder4
>img
The first part would return 4, and the second script would return 2.
Is this possible to do either from CMD or with some Windows tool?
I've had a look around and the closest I could find was a CLI script to print all folders and sub-folders to a file :
dir /directory:n /ad > f.txt
Which I could then copy paste into Notepad++ and do some manual messing around with...but I was hoping there was a cleaner/faster solution than this in case I ever come across this in the future. What would I need to write for this?