ewang1205
asked on
count number of files using dos command and then email to me the count
I like to the count number of files using dos command and then email to me the count. Not sure if dos can send email. So, count the number of files and store the count in a file. Thanks.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Result:
For arround 1 300 000 files on a RAID 0 Dual SSD drive
dir /a-d /s /b "%ThePath%" ^|find /c /v "" : TOOK: 1min25secs
dir /s %ThePath% ^| FINDSTR -i "file" : TOOK: 1h30mins
I did not test the precision of the results I'll let this to be tested by one of you.
So my last batch file, and including "athar_anis" find command line seems to be the best solution.
Cheers,
Rene
For arround 1 300 000 files on a RAID 0 Dual SSD drive
dir /a-d /s /b "%ThePath%" ^|find /c /v "" : TOOK: 1min25secs
dir /s %ThePath% ^| FINDSTR -i "file" : TOOK: 1h30mins
I did not test the precision of the results I'll let this to be tested by one of you.
So my last batch file, and including "athar_anis" find command line seems to be the best solution.
Cheers,
Rene
To add to my previous statment:
I did not test the precision of the results I'll let this to be tested by one of you.
MEANING:
I did not test the precision of the file count results I'll let this to be tested by one of you.
I did not test the precision of the results I'll let this to be tested by one of you.
MEANING:
I did not test the precision of the file count results I'll let this to be tested by one of you.
ASKER
Great job! Outstanding work!
As they were not exactly the same:
dir /a-d /s /b "%ThePath%" ^|find /c /v "" : TOOK:1min25secs FILE COUNT:1319444
dir /s %ThePath% ^| FINDSTR -i "file" : TOOK:1h30mins FILE COUNT:1319960
Thinking about it, I'd say that the one that has the highest file count wins, but it takes longer. Depending misc confige and NTFS security settings... both command lines may give you the same file count results.
Have fun!
dir /a-d /s /b "%ThePath%" ^|find /c /v "" : TOOK:1min25secs FILE COUNT:1319444
dir /s %ThePath% ^| FINDSTR -i "file" : TOOK:1h30mins FILE COUNT:1319960
Thinking about it, I'd say that the one that has the highest file count wins, but it takes longer. Depending misc confige and NTFS security settings... both command lines may give you the same file count results.
Have fun!
Thanks ewang1205
Cheers,
Rene
Cheers,
Rene
Open in new window