Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run a batch file from button click in delphi7

I have a batch file and an application developed in delphi7. Both are working fine. I want to run the batch file when clicking a button. what can I do for that?

Thanks Nelson

like image 374
Nelson T Joseph Avatar asked Feb 23 '23 20:02

Nelson T Joseph


1 Answers

Use ShellExecute which is declared in ShellAPI.

ShellExecute(
    MainForm.Handle,
    'open',
    PChar(scriptfilename),
    PChar(params),
    PChar(workingdirectory),
    SW_SHOW
);
like image 148
David Heffernan Avatar answered Mar 05 '23 16:03

David Heffernan