Right() is a vb6 function , try this ... ( which works fine )
VB Code:
  1. Dim strPath As String = Application.StartupPath
  2.         If Not strPath.EndsWith("\") Then
  3.             strPath += "\"
  4.             MessageBox.Show(strPath)
  5.         End If