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;

 

posted @ 2018-03-07 16:16  夏天的西瓜君  阅读(832)  评论(0编辑  收藏  举报