procedure TForm1.Button1Click(Sender:TObject); var sExePath:string; begin sExePath:=ExtractFilePath(Application.ExeName); ShowMessage(sExePath); end;