Would any one help me to solve the problem??

I am writing a vb program by using vb 6.0. I want to location a file with .id extension. how can i find out this file c:/program/abc.id if i only know the extension and the path??

Thank you very much~~

Well, Firstly, the slashes should be the other way.... I know in later versions of windows it understands both, but if you run it on a box that is earlier versions of window, most likely ME or 98, it will get pretty upset with you. The keyword to check if a file exists, is "dir", and you can use it to check for wildcards as such:

Dim Fname As String
Fname = Dir("c:\program\*.id", vbNormal)
While Fname <> ""
    MsgBox Fname
    Fname = Dir
Wend

That will only msgbox (popup) the names of all the files ending in .id in the c:\program directory.... if you want to Search The Entire Hard Drive, you can do that too... let me know if you have any further questions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.