uses ShellApi;
procedure TForm1.Button1Click(Sender: TObject); var filename, Path: string; begin filename := 'D:WmgjServer146serverstart.bat'; Path := ExtractFilePath(filename); SetCurrentDir(Path); ShellExecute(Handle, 'open', PWideChar(filename), 'run', nil, SW_SHOWNORMAL); end;