Results 1 to 3 of 3

Thread: [RESOLVED] Retrieve Directory Contents

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2002
    Posts
    54

    Resolved [RESOLVED] Retrieve Directory Contents

    If I know the path to my folder, how can I retrieve the name of a file it contains if I don't know the filename before hand please?

  2. #2
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Retrieve Directory Contents

    if VB6, then one option would be to do something like
    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim sPath As String
    3.     sPath = "C:\Path\To\File\"
    4.     Debug.Print Dir(sPath & "*.*")
    5. End Sub
    (if there's just one file in the folder that is.)

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2002
    Posts
    54

    Re: Retrieve Directory Contents

    Yes it's VB6 and yes there should only by 1 file.

    Thats most helpful, thanks a lot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width