Click to See Complete Forum and Search --> : How to get a Path of a file


tvsankar72
December 14th, 2003, 11:37 PM
Hi VC++ experts,
I want to get the full path of a file(For example c:\Mytrial\Sample\Display.txt ) by just giving the file name(For example Display.txt) as input

The File may be present at anyone of the drives in my PC (Any random directory path). I want to find the full path of the file by running a C++ or VC++ code from some other drive in the same PC and giving just the file name as input( For example Display.txt ) to the code.

I tried with CFileFind class without success. Any VC++ experts help me by sending some sample code.
By
T.V.Sankar

vicodin451
December 15th, 2003, 07:35 AM
Originally posted by tvsankar72
Hi VC++ experts,
I want to get the full path of a file(For example c:\Mytrial\Sample\Display.txt ) by just giving the file name(For example Display.txt) as input

The File may be present at anyone of the drives in my PC (Any random directory path). I want to find the full path of the file by running a C++ or VC++ code from some other drive in the same PC and giving just the file name as input( For example Display.txt ) to the code.

I tried with CFileFind class without success. Any VC++ experts help me by sending some sample code.
By
T.V.Sankar
I think you might get more responses if you posted this in a more pertinent forum, such as the Visual C++ forum.
At any rate, check out this FAQ (http://www.codeguru.com/forum/showthread.php?s=&threadid=231184)...