Getting a list of files in a directory 
Author Message
 Getting a list of files in a directory

Hi

I have an operation I want to perform on each file in a given directory.
Right now I have it to where I can enter a single filename and have the
action performed.  How would I go about getting the name of each file in the
directory, opening it, and performing the action?

thanks

-Bryan



Mon, 05 Nov 2001 03:00:00 GMT  
 Getting a list of files in a directory
Try this sample:::

Private Sub Command1_Click()

Dim sFile   As String

ChDir "c:\windows"

sFile = Dir("*.*")

Do While sFile <> ""
    Debug.Print sFile
    sFile = Dir
Loop

End Sub


Quote:
>Hi

>I have an operation I want to perform on each file in a given directory.
>Right now I have it to where I can enter a single filename and have the
>action performed.  How would I go about getting the name of each file in
the
>directory, opening it, and performing the action?

>thanks

>-Bryan



Mon, 05 Nov 2001 03:00:00 GMT  
 Getting a list of files in a directory
Raj/Bryan
 Take a look at the DirListBox and FileListBox Controls.
And/Or Dir function. Loop...FreeFile, Open, Input, Close.
Typing all those filenames must be a real pain in the ass!!!
Neila

Quote:

>Hi

>I have an operation I want to perform on each file in a given directory.
>Right now I have it to where I can enter a single filename and have the
>action performed.  How would I go about getting the name of each file in
the
>directory, opening it, and performing the action?

>thanks

>-Bryan



Tue, 06 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting list of files in a directory

2. getting list of files in a directory

3. Getting a detailed directory listing using Internet transfer control, file sizes

4. getting list of directories into list box

5. ?? Getting Directory Listing with qbasic

6. Getting directory list of a folder's contents

7. Getting a http directory list.

8. Getting Directory List

9. Getting Recursive Directory List...

10. Problem getting directory listing

11. Getting a directory listing

12. Selecting files in many directories, use of file list box

 

 
Powered by phpBB® Forum Software