Using VB 6
I want to select path only?
Selected Path - C:\Documents and Settings\Administrator\My Documents\1.txt
code:
Public Function Getpath01(sFile As String) As String
  Dim iPos As Long
    For iPos = Len(sFile) To 1 Step -1
    If Mid$(sFile, iPos, 1) = "\" Then
      Getpath01 = Left$(sFile, iPos)
      Exit Function
    End If
  Next
    Getpath01 = sFile
End Function
From the above code i am getting.
C:\Documents and Settings\Administrator\My Documents\
I don't want to display last "\" also
Expected Output
C:\Documents and Settings\Administrator\My Documents
How to modify a code?
Need vb6 code Help.