wasabi3689
asked on
how to count files?
I have a directory with its sub -dir. Each sub dir has date with its folder like below. Each date folder has many files
2016
20160101
20160102
20160103
........
20161231
I want to count number of files in each date directory, output to EXCEL. The output should be something like below
2016
20160101 34
20160102 230
20160103 1234
........
20161231 90
How to do this in DOS script
2016
20160101
20160102
20160103
........
20161231
I want to count number of files in each date directory, output to EXCEL. The output should be something like below
2016
20160101 34
20160102 230
20160103 1234
........
20161231 90
How to do this in DOS script
ASKER
it outputs something else.
Here is what I run
Here is what I run
@echo off
set RootDir=c:\local\test
for /d %%A in (%\\test2\NGProduction\FinalDocs\HPMG\Documents_doc_InterfaceProc\2016%\*) do (
for /f "tokens=1" %%a in ('dir "%%A\*" ^| find /i "File(s) "') do (echo %%~nA %%a)
)
pause
ASKER
also, I want to output to an Excel file
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Change RootDir to your needs.
Open in new window