ShellExecute 调用bat文件
ping-baidu.bat 文件内容
ping www.baidu.com -t
procedure TForm2.cxbtn1Click(Sender: TObject); var exePath:string; begin exePath := ExtractFilePath(Application.ExeName) +'ping-baidu.bat'; ShellExecute(Handle, 'open', PChar(exePath), nil, nil, SW_SHOW); end;