|
-
Oct 28th, 2000, 08:02 AM
#1
Thread Starter
Lively Member
Hello,
The following routine populates a LISTVIEW control with a list of files that are contained in a text file. I would like to modify this so that the .EXE and .BAT files that are in a specific directory are loaded, for example, app.path
Is there any way to do this without doing a DIR *.EXE > FILES.LST, then loading the file, the deleting the file ?
Open App.Path & "\FILES.LST" For Input As #1
Do While Not EOF(1)
Line Input #1, STemp
Set liEntry = ListView1.ListItems.Add(, , STemp, 0, 0)
Loop
Close #1
Thanks,
-
Oct 28th, 2000, 08:27 AM
#2
Hyperactive Member
I added a command button and a listbox to the form. I'm sure you can modify this to your needs.
Private Sub Command1_Click()
Dim FileDir As String
FileDir = Dir("C:\Windows\")
While FileDir <> ""
DoEvents
If UCase(Right(FileDir, 3)) = "BAT" Or _
UCase(Right(FileDir, 3)) = "EXE" _
Then
List1.AddItem FileDir
End If
FileDir = Dir
Wend
End Sub
-
Oct 28th, 2000, 08:43 AM
#3
Thread Starter
Lively Member
Worked great. Thanks for your help...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|