procedure tform1.button1click(sender:tobject);
begin
executefile(filename,'',directory,SW_SHOW);
end;
function executefile(const filename,params,defaultdir,string;
showcmd:integer):thandle;
var
zfilename,zparams,zdir:array[0..79] of char;
begin
result:=shellexecute(application.Mainform.handle,nil,
strpcopy(zfilename,filename),strpcopy(zparams,params),
strpcopy(zdir,defaultdir),showcmd);
end;