CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 1999
    Location
    Bangalore
    Posts
    60

    Finding a file in a directory

    Hi all

    Can anybody give me an idea for Finding a file in a particular directory(incliding wildcards). I tried using FSO but it is not working with wildcards.


    Thanks in advance
    Venky


  2. #2
    Guest

    Re: Finding a file in a directory

    Hi,

    Hi Venky,

    Finding a single file or Directory using (GetFile attributes)Win 32 API is possible. But if you use wild card search it will not work.
    You have to give the full path of a file/ Directory in the API. If you need the code (very simple) I can send. FSO I have tried. But
    in that case also if it is wild card search you won't get. It appears, basically you have to give individual file / directory path in any
    case.

    Bye,

    satya
    Email : [email protected]




  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: Finding a file in a directory

    you can use VB's built-in Dir function:

    dim strfile as string
    strfile = Dir("c:\winnt\system32\*.dll")
    do while strfile <> ""
    debug.print strfile
    strfile = dir
    Loop





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

Featured