Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure CheckButtonClick(Sender: TObject);
- var
- ResultCode: Integer;
- begin
- // SW_HIDE - keep the console window hidden
- // ewWaitUntilTerminated - wait for the executed file to finish
- if Exec('<path to your batch file>', '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
- begin
- // the batch file execution finished; the ResultCode variable contains its exit code
- end
- else
- begin
- // the batch file could not be executed
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment