Path from path???
Not sure where you get the idea Dir only gives the last folder. Dir works in
two ways, you can check if a particular folder (or file) exists, or you can
loop (typically Do-While) an entire folder to return all its folders and
subfolders until Dir returns empty. In the loop you can check for your
pattern match, if it matches (eg with the Like operator) recursively call
the same routine passing the found folder as the parent folder for the next
call, and so on. Also pass the folder level incrementing with +1 (be sure to
do that ByVal) and say a string array for each of your folder generations to
compare with in the given "level".
Also I don't follow what you mean or your objective when you say you
"provide these paths". In the second example would
"C:\FoDder1\Folder2\Folder3\" be correct or incorrect, and if incorrect why.
What are you actually trying to do.
You might also use FSO which is perhaps more intuitive, though generally I
prefer Dir.
Regards,
Peter T
"Charlotte E." wrote in message
...
How to find/get the FULL path from a path with pattern recognition???
If I provide these paths:
C:\Folder1\Folder2\Folder3\
C:\Fo?der1\Folder2\Folder3\
C:\Folder1\Fol*der2\Folder3\
C:\Folder1\Folde?2\?older3\
C:\Fol?er1\Fo*der2\Fo*der3\
C:\Fol*der1\Folder2\Fold?er3\
...I would like to retreive
C:\Folder1\Folder2\Folder3\
...in all cases?
Apparrently DIR() only give the last folder, and only if the middle folder
doesn't contain a pattern char!
FileSystemObject won't return and full path if given a pattern path!
API 'GetLongPathName' fails completely if using pattern chars!
What am I missing?!?
..and if I'm putting in the short name extender (~) everything goes south
How to get the FULL path, no matter what pattern chars I have included in
the path???
Thanks,
CE
|