From the help file (type Dir and hit F1), it gives all arguments and their
descriptions.
Dir(pathname[, attributes])]
Pathname you already have, the attributes argument is the optional second,
which has to be an integer that is the sum of any of the given constants
(they do this so you can use more than one constant here). The windows file
attributes are as follows:
vbNormal = 0
vbReadOnly = 1
vbHidden = 2
vbSystem = 4
vbVolume = 8
vbDirectory = 16
So therefore, you can show Normal, Hidden, Readonly and System files all at
once by supplying the second argument as 7 (0+1+2+4)
Dir("C:\YourPath\", 7)
or
Dir("C:\YourPath\", vbNormal + vbReadOnly + vbHidden + vbSystem)
the help file is a highly underrated tool, and every keyword can be pulled
up by pressing F1 with the cursor on the right side of the word from within
the vba ide.
--
Jack Leach
www.tristatemachine.com
"I haven't failed, I've found ten thousand ways that don't work."
-Thomas Edison (1847-1931)
"Fredrated" wrote:
> Sorry, I should have been a little more compete in my answer.
>
> I am using "I:\Dorn\DOCS\*.*" as the initial DIR$ argument.
> Are there other arguments that can be used with Dir$?
>
> Thanks
>
> Fred
>
>
> Is there
> "Jack Leach" wrote:
>
> > > > > in the folowing loop, dir$ gives me 37,184 files, but windows explorer
> > > > > directory properties says there are 37,315 files.
> >
> > > 'Show hidded files' is selected in win explorer, so I think it is a file
> > > limit problem.
> >
> > I guess my point here was, if explorer is showing more files than Dir, and
> > you happen to be showing hidden/system files in explorer, there's a good
> > chance the Dir function is only returning the non-hidden files (as I believe
> > it's defaulted to do when no arguments are supplied).
> >
> > I would try working with the Dir filetype arguments to see if you can show
> > the difference of 131 files being hidden or system. I would think that a
> > filelimit error would have more drastic effects than what you are seeing.
> >
> > --
> > Jack Leach
> > www.tristatemachine.com
> >
> > "I haven't failed, I've found ten thousand ways that don't work."
> > -Thomas Edison (1847-1931)
> >
> >
> >
> > "Fredrated" wrote:
> >
> > > 'Show hidded files' is selected in win explorer, so I think it is a file
> > > limit problem.
> > > I am going to copy 10,000 files into another directory and see if I can then
> > > get better results.
> > >
> > > By the way, DOS says I have 37,200 files!
> > >
> > > Thanks for your reply.
> > >
> > > Fred
> > >
> > >
> > > "Jack Leach" wrote:
> > >
> > > > Two things to look at: first, I think you may be nearing the limit for the
> > > > number of files allowed in a folder. I'm not positive, but I think you're
> > > > close.
> > > >
> > > > Also, have you checked for hidden/system files? The second argument of the
> > > > dir function lets you define the types... you may get different results by
> > > > playing around with this (and depending on your system settings for explorer).
> > > >
> > > > hth
> > > > --
> > > > Jack Leach
> > > > www.tristatemachine.com
> > > >
> > > > "I haven't failed, I've found ten thousand ways that don't work."
> > > > -Thomas Edison (1847-1931)
> > > >
> > > >
> > > >
> > > > "Fredrated" wrote:
> > > >
> > > > > using dir$ I don't seem to get all of the files in a director.
> > > > >
> > > > > in the folowing loop, dir$ gives me 37,184 files, but windows explorer
> > > > > directory properties says there are 37,315 files.
> > > > > (These files are stored in one directory by a commercial application, I have
> > > > > no control over this)
> > > > >
> > > > > CODE:
> > > > > strFile = Dir$(strDir)
> > > > > rs.AddNew
> > > > > rs!Filename = strFile
> > > > > rs.Update
> > > > >
> > > > > Do While True
> > > > >
> > > > > strFile = Dir$()
> > > > > If strFile = "" Then GoTo Done
> > > > >
> > > > > rs.AddNew
> > > > > rs!Filename = strFile
> > > > > rs.Update
> > > > >
> > > > > Loop
> > > > >
> > > > > Done:
> > > > > etc. etc.
> > > > > ENDCODE
> > > > >
> > > > > A (possibly related) problem is that windows explorer can't seem to list all
> > > > > the files in name order, perhaps because there are too many to handle
> > > > > properly?
> > > > >
> > > > > For example, the following is a typical section of the directory list, in
> > > > > name order:
> > > > > 2nd 15 E 4Th (13)1.jpg
> > > > > 02-Right fender1.JPG
> > > > > 3-18-03ACK1.doc
> > > > > 03 View of trees1.jpg
> > > > > 3KubicACK1.doc
> > > > > 03-Right door1.JPG
> > > > >
> > > > > Any suggestion are welcome, since we are about to ditch this application. I
> > > > > am in the process of trying to determine the completeness and accuracy of the
> > > > > data, but things like the dir$ problem and the seemingly odd behavior of the
> > > > > directory list are getting in the way.
> > > > >
> > > > > Any suggestions greatly appreciated, thanks in advance for any help.
> > > > >
> > > > > Fred
> > > > >
> > > > >