Private Sub Form_Load()
file_name_full = "c:\windows\command\cmd.com"
file_path = Left(file_name_full, InStrRev(file_name_full, "\"))
file_name = Right(file_name_full, Len(file_name_full) - InStrRev(file_name_full, "\"))
MsgBox file_path
MsgBox file_name
End Sub
file_name_full = "c:\windows\command\cmd.com"
file_path = Left(file_name_full, InStrRev(file_name_full, "\"))
file_name = Right(file_name_full, Len(file_name_full) - InStrRev(file_name_full, "\"))
MsgBox file_path
MsgBox file_name
End Sub
Dim temp
temp = Split(longpath, "\")
shortpath = temp(UBound(temp))
End FunctionPrivate Sub Command1_Click()
MsgBox shortpath("c:\windows\command\cmd.com")
End Sub