Philip Steiner
Things I'd forget if I didn't post them here.
Pages
Home
Windows
Batch
Perl
Wednesday, December 19, 2018
Count directories with Windows command line
cd C:\Foo
REM Foo contains 2 files and 3 folders
dir /b
file1.txt
file2.txt
Folder1
Folder2
Folder3
REM Filter out files and '.' and '..' folders
for /f %i in ('dir /b /ad-s-h ^| find /i /v /c ""') do @echo %i
3
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)