Execute an external program from Delphi

uses ShellAPI;

procedure TForm1.Button1Click(Sender: TObject);
begin
     //Use the API ShellExecute to run NOTEPAD.EXE
     ShellExecute(0,'open',PChar('notepad.exe'),nil,nil,SW_NORMAL);
end;

 

Copyright 2001-2005 (C) ykwong.com All rights reserved.