Delphi 调用批处理

 

 

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;

 

posted @ 2014-01-21 15:13  XE2011  阅读(900)  评论(0编辑  收藏  举报