Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get a specific directory

Status
Not open for further replies.

DaRedMonkey

IS-IT--Management
Aug 23, 2002
17
US


I have the following code snippet that list all file in a directory with ABC* pattern. But, it only list file in the directory that the VB script is in. How do I specify which directory to list. So, that it doesn't matter where the VB script resides.

Private Sub Command3_Click()
'Load an ini file into the textbox
CommonDialog1.DialogTitle = "Load KLARF file"
CommonDialog1.Filter = "klarf files (ABC.*)|ABC.*"
CommonDialog1.ShowOpen
If CommonDialog1.FileName = "" Then Exit Sub

Open CommonDialog1.FileName For Input As #1
RichTextBox1.Text = Input$(LOF(1), #1)
Close #1
End Sub
 
If you want it to start out in a default directory you can add something like this.

CommonDialog1.InitDir = "c:\SomeFolder"
 


Thank you .. thank you .. thank you.

That work wonderfully.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top