this is from the MSDN , it uses FileSystemObject which is availible in Visual Basic, this doesnt say it does what you are asking, but if you look at one of the click commands, it returns the filesize of a file it passes to it.<br><br><FONT FACE=monospace><br>HOWTO: Use FileSystemObject with Visual Basic <br><br>--------------------------------------------------------------------------------<br>The information in this article applies to:<br><br>Microsoft Visual Basic Learning, Professional, and Enterprise Editions for Windows, versions 5.0, 6.0<br><br>--------------------------------------------------------------------------------<br><br><br>SUMMARY<br>FileSystemObject provides a non-hierarchical structure to manipulate, read, and create ASCII and Unicode text files. This structure is very different from the hierarchical structure of the original implementation of File I/O in Visual Basic. FileSystemObject does not support binary file access, so you must still use the original File I/O model in Visual Basic for binary file access. <br><br><br><br>MORE INFORMATION<br>FileSystemObject can be found in Scrrun.dll. In addition to FileSystemOject, Scrrun.dll includes four other objects available for File I/O and other tasks. These objects include the File object, the TextStreamObject object, the Folder object, and the Drive object. All of these objects have properties and methods that are detailed in the Help files. <br><br>You can obtain Scrrun.dll by installing one of the following packages: <br><br><br>Windows Script Host<br>Windows NT Option Pack<br>Microsoft Internet Information Server 3.0<br>Scripting 3.1 upgrade<br>Visual Studio 6.0<br>Visual Basic 6.0 <br><br>FileSystemObject was originally created for the Visual Basic Scripting Edition. FileSystemObject is not included in the object library for Visual Basic or Visual Basic for Applications. To use FileSystemObject, you must select the Microsoft Scripting Run-time in the Project References dialog box for your project. <br><br>The following sample illustrates how to implement some of the FileSystemObject functionality. For more information, please see the Visual Basic Help files and the Visual Basic Books Online. <br><br>Steps to Create Sample Project<br>Start a new Standard EXE project in Visual Basic. Form1 is created by default. <br><br><br>Click References on the Project menu and select the Microsoft Scripting Runtime. If the Microsoft Scripting Runtime does not appear in the list, browse for Scrrun.dll on your system. Install one of the tools listed previously if necessary. <br><br><br>Add four CommandButton controls to Form1. The CommandButton controls demonstrate the following functionality:<br><br><br> Command1: How to read an existing text file using FileSystemObject<br> and TextStreamObject.<br><br> Command2: How to view file information using FileSystemObject and<br> the File object.<br><br> Command3: How to iterate through folders using FileSystemObject and<br> the Folder object.<br><br> Command4: How to view drive information using FileSystemObject and<br> the Drive object.<br> <br>Paste the following code into the General Declarations section of Form1:<br><br><br> Option Explicit<br><br> Private Sub Command1_Click()<br> 'Declare variables.<br> Dim fso As New FileSystemObject<br> Dim ts As TextStream<br> 'Open file.<br> Set ts = fs

penTextFile(Environ("windir"

& "\system.ini"

<br> 'Loop while not at the end of the file.<br> Do While Not ts.AtEndOfStream<br> Debug.Print ts.ReadLine<br> Loop<br> 'Close the file.<br> ts.Close<br> End Sub<br><br><b> Private Sub Command2_Click()<br> Dim fso As New FileSystemObject<br> Dim f As File<br> 'Get a reference to the File object.<br> Set f = fso.GetFile(Environ("windir"

& "\system.ini"

<br> MsgBox f.Size 'displays size of file<br> End Sub</b><br><br> Private Sub Command3_Click()<br> Dim fso As New FileSystemObject<br> Dim f As Folder, sf As Folder, path As String<br> 'Initialize path.<br> path = Environ("windir"

<br> 'Get a reference to the Folder object.<br> Set f = fso.GetFolder(path)<br> 'Iterate through subfolders.<br> For Each sf In f.SubFolders<br> Debug.Print sf.Name<br> Next<br> End Sub<br><br> Private Sub Command4_Click()<br> Dim fso As New FileSystemObject<br> Dim mydrive As Drive<br> Dim path As String<br> 'Initialize path.<br> path = "C:\"<br> 'Get object.<br> Set mydrive = fso.GetDrive(path)<br> 'Check for success.<br> MsgBox mydrive.DriveLetter 'displays "C"<br> End Sub<br> <br>Run your project. Click each CommandButton control and observe the results. <br><br><br><br><br><br>REFERENCES<br>For information, please see the following article in the Microsoft Knowledge Base: <br><br><br>Q185601 HOWTO: Recursively Search Directories Using FileSystemObject <br><br>Additional query words: <br><br>Keywords : kbFileIO KbVBA kbVBp kbVBp500 kbVBp600 kbGrpVB kbDSupport <br>Version : WINDOWS:5.0,6.0 <br>Platform : WINDOWS <br>Issue type : kbhowto <br>Technology : <br></font><br><br> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href=
</a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)