Yes, you can get a list of files and directories with Dir, but you
have much more control with FSO.
This is from Microsoft:
The FileSystemObject cl*** gives better performance than using such
Visual Basic intrinsic functions as Dir and GetAttr, and is much
simpler to implement.
In addition, you can get a lot of information using the FSO, as in
another Microsoft example...
Sub ShowFolderInfo()
Dim fso, fldr, s
' Get instance of FileSystemObject.
Set fso = CreateObject("Scripting.FileSystemObject")
' Get Drive object.
Set fldr = fso.GetFolder("c:")
' Print parent folder name.
MsgBox ("Parent folder name is: " & fldr)
' Print drive name.
MsgBox ("Contained on drive " & fldr.Drive)
' Print root file name.
If fldr.IsRootFolder = True Then
MsgBox ("This is the root folder.")
Else
MsgBox ("This folder isn't a root folder.")
End If
' Create a new folder with the FileSystemObject object.
fso.CreateFolder ("C:\Bogus")
MsgBox ("Created folder C:\Bogus")
' Print the base name of the folder.
MsgBox ("Basename = " & fso.GetBaseName("c:\bogus"))
' Delete the newly created folder.
fso.DeleteFolder ("C:\Bogus")
MsgBox ("Deleted folder C:\Bogus")
End Sub
Do some research before you condem the FSO, then if you don't like it,
don;t use it.
J French, why the big hang up?
-Eddie
On Tue, 17 Aug 2004 06:45:16 +0000 (UTC),
EMAIL REMOVED (J
French) wrote:
>Ignore that nonsense about the FSO - it is a crock of sch**t