Maybe:

Sub Rename_All()

    Dim lastRow As Long, row As Long
    Dim path As String
    
    lastRow = Cells(Rows.Count, "A").End(xlUp).row
    For row = 1 To lastRow
        path = Left(Cells(row, "A").Value, InStrRev(Cells(row, "A").Value, "\"))
        Name path & Cells(row, "A").Value As path & Cells(row, "B").Value
    Next
    
End Sub