Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I would like to get the number of immediate sub-directories there are for certain directories.
The command I am using now is
dir "dir_path" | find "bytes free" >> output.txt
This gives me a line of output, e.g.
13 Dir(s) 25,086,881,792 bytes free
What I would really like in the output file is to have just the number of directories, e.g. 13 in the example above.
Can anyone help pls?

Maybe you could try this: if you manage to enter this line, as a series of parameters after calling a program:
program.bat 13 Dir(s) 25,086,792 bytes free
and then let the program.bat just perform: echo %1 .. this will then display "13"
Miskva

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |