Home All Groups Group Topic Archive Search About
Author
25 Feb 2009 11:51 PM
Jeff Harbin
I've created this code before and I lost it so I'm trying to recreate
it.  I want to programmically create a txt file that contains a list of
the contents of a directory (both file name and size).  I know how to
generate the output file but I'm having some difficulty capturing the
data to output.

In the past I've done something with a FileSystemObject I believe (not
positive) and I'm drawing a blank on getting started.

FYI...I'm using VB6 (still, I know).

Thanks

Jeff

Author
26 Feb 2009 12:07 AM
Bob Butler
"Jeff Harbin" <prez1***@sbcglobal.net> wrote in message
news:YJkpl.12835$8_3.8034@flpi147.ffdc.sbc.com...
> I've created this code before and I lost it so I'm trying to recreate it.
> I want to programmically create a txt file that contains a list of the
> contents of a directory (both file name and size).

s=dir$(path & "\*.*",vbhidden or vbsystem)
do while len(s)>0
  txtList.text=txtlist.text & s & " (" & filelen(path & "\" & s) & ")" &
vbcrlf
  s=dir$
loop

> I know how to generate the output file but I'm having some difficulty
> capturing the data to output.

generate the output file?  huh?

> In the past I've done something with a FileSystemObject I believe (not
> positive) and I'm drawing a blank on getting started.

The FSO is for scripting; it has no place in a VB app unless it's throwaway
code

> FYI...I'm using VB6 (still, I know).

Nothing wrong with still using VB6.  It's a heck of a lot more fun, and IMO
productive, than anything that came after it.