TLama

Untitled

Jul 5th, 2013
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.46 KB | None | 0 0
  1. procedure CheckButtonClick(Sender: TObject);
  2. var
  3.   ResultCode: Integer;
  4. begin
  5.   // SW_HIDE - keep the console window hidden
  6.   // ewWaitUntilTerminated - wait for the executed file to finish
  7.   if Exec('<path to your batch file>', '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
  8.   begin
  9.     // the batch file execution finished; the ResultCode variable contains its exit code
  10.   end
  11.   else
  12.   begin
  13.     // the batch file could not be executed
  14.   end;
  15. end;
Advertisement
Add Comment
Please, Sign In to add comment