新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Sub Command1_click()
Dim strAll As String
Dim strArr() As String
Dim strPath As String
Dim strFN As String
Dim i As Integer
strAll = "C:\Windows\System\system.dll"
strArr = Split(strAll, "\")
strFN = strArr(UBound(strArr))
strPath = Left(strAll, Len(strAll) - Len(strFN))
Debug.Print strPath
Debug.Print strFN
End Sub