-
-
Code:
' assumes you are looking in a specific directory, say strDirectory = "C:\"
If Dir$(strDirectory & ListView1.SelectedItem.Text, vbNormal Or vbHidden Or vbArchive Or vbSystem Or vbReadOnly) Then
MsgBox "File"
ElseIf Dir$(strDirectory & ListView1.SelectedItem.Text, vbDirectory) Then
MsgBox "Folder"
End If
should work...
-
Or this, which you can change to fit your needs.
Code:
Private Sub Command1_Click()
If GetAttr("C:\test") = vbDirectory Then
MsgBox "Directory"
ElseIf GetAttr("C:\test.txt") = vbNormal Then
MsgBox "File"
End If
End Sub
-
another one of those damn functions that I didn't know about!! Megatron told me about SetAttr() or Save Attr() I forget which is right, I gues it only stood to reason that a Get Attr() function existed...Thanks for the info, Lethal :D
-
No problem, the one Megatron was referring to was SetAttr() function. :cool: