Eigenes Verzeichnis ermitteln

Exe-Verzeichnis durch Application.StartupPath und Reflection.Assembly ermitteln



Eigenes Verzeichnis mit Application.StartupPath und Reflection.Assembly ermitteln

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  MsgBox(Application.StartupPath) Exe path
End Sub
 
 
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  Dim ExeDir, ExeName As String
  ExeName = Reflection.Assembly.GetExecutingAssembly.Location
  ExeDir = IO.Path.GetDirectoryName(ExeName)
 
  MsgBox(ExeDir)
End Sub