Link to home
Create AccountLog in
Avatar of Charlie_Melega
Charlie_Melega

asked on

Command line function or utility that can calculate number of files in a directory

Hello,

Is anyone aware of a DOS\Windows based command line function or utility that when run will generate the number of files in a specified folder or directory?  This seems fairly straightforward but I cannot locate such a function\utility for Windows\DOS based platform. I have seen multiple command line options for UNIX.

Thanks for any assistance, this issue is urgent.


Charlie

Avatar of AmazingTech
AmazingTech

dir folder /s

The last File(s) should be the number of files.

     Total Files Listed:
               9 File(s)         44,625 bytes
               8 Dir(s)  18,117,754,880 bytes free
Right click your folder and select properties should have Contains
number of files and folders.
Please check this page: http://unxutils.sourceforge.net/
You can perfectly use "dir /b | wc - l " as soon as you get wc.exe installed

I do not believe you can find "natural Windows" way of counting files
ASKER CERTIFIED SOLUTION
Avatar of Shift-3
Shift-3
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
To reduce output from AmazingTech's suggestion you could search for File(s)

C:> dir | find "File(s)"
Avatar of Charlie_Melega

ASKER

Thank You all for the answers.

Shift-3 script just the numeric value of file count which it what I was looking for.

Cheers,


Charlie