Hello,
I need to check if a path specified is file or folder/volume... all "FileExists" functions I found return True if I pass them a folder path... how do I check if path is folder or file?
thanks in advance,
Darko
Printable View
Hello,
I need to check if a path specified is file or folder/volume... all "FileExists" functions I found return True if I pass them a folder path... how do I check if path is folder or file?
thanks in advance,
Darko
If you have at least IE4, you can use PathIsDirectory...
VB Code:
Private Declare Function PathIsDirectory Lib "shlwapi.dll" Alias "PathIsDirectoryA" (ByVal sPath As String) As Long Private Sub Command1_Click() MsgBox CBool(PathIsDirectory("c:\users")) End Sub
Perfect... :bigyello:
thanks!
Or you can do :
VB Code:
Dir$(FilePath, vbDirectory)
to see if it's a valid dir... Although the API way is definatelly better :)