procedure TForm1.Button1Click(Sender: TObject);
var
fileName, Path: string;
begin
fileName := 'D:\ServerTest.bat';
Path := ExtractFilePath(fileName);
SetCurrentDir(Path);
ShellExecute(Handle, 'open', PWideChar(filename), 'run', nil, SW_SHOWNORMAL);
end;
Delphi 调用批处理
最新推荐文章于 2024-04-23 11:16:57 发布