本文整理自网络,侵删。
uses ShellApi;
procedure TForm1.Button1Click(Sender: TObject);
var filename, Path: string;begin filename := 'D:\WmgjServer146\server\start.bat'; Path := ExtractFilePath(filename); SetCurrentDir(Path); ShellExecute(Handle, 'open', PWideChar(filename), 'run', nil, SW_SHOWNORMAL);end;
相关阅读 >>
Delphi windows 编程[7] - wm_create 消息
Delphi中转向语句break,continue,exit的作用
Delphi 10分钟10行代码开发app(Delphi 应用案例)
更多相关阅读请进入《Delphi》频道 >>