Discrepancy between a CMD file count, and a Windows file count...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm exporting a bunch of images from a database, and I need to know how many
of them are on an external USB hard drive. When I run - CMD dir /s *.tif -
it shows me as having 568,132 files, when I do it by right clicking on all of
the folders inside of the G drive, which is where my images are stored, I see
508,176 files.

I decided to try it on my local computer, on my Program Files directory.

With CMD - 16,376 files and 4079 directorys
With Windows - 16,456

What in the world is going on? I've got to know how many images there
are.....
 
NMan said:
I'm exporting a bunch of images from a database, and I need to know how many
of them are on an external USB hard drive. When I run - CMD dir /s *.tif -
it shows me as having 568,132 files, when I do it by right clicking on all of
the folders inside of the G drive, which is where my images are stored, I see
508,176 files.

I decided to try it on my local computer, on my Program Files directory.

With CMD - 16,376 files and 4079 directorys
With Windows - 16,456

What in the world is going on? I've got to know how many images there
are.....

dir /s, when executed from a command prompt, counts the "dotted"
folder entries that are visible at the top of each directory listing:
<DIR> .
<DIR> ..
Explorer does not count them. You can count them like so:
dir /s /ad | find /c " ."

dir /s does not count hidden files unless you add an extra switch.
 
I'm exporting a bunch of images from a database, and I need to know how many
of them are on an external USB hard drive. When I run - CMD dir /s *.tif -
it shows me as having 568,132 files, when I do it by right clicking on all of
the folders inside of the G drive, which is where my images are stored, I see
508,176 files.

I decided to try it on my local computer, on my Program Files directory.

With CMD - 16,376 files and 4079 directorys
With Windows - 16,456

What in the world is going on? I've got to know how many images there
are.....

In Explorer, the Folder Options Advanced Hode options are in effect.

The CMD.EXE DIR command should be run with /a swich to retrieve files of all attributes.


Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top