procedure TForm1.Button1Click(Sender: TObject); var w1: Word; p1, p2: array[0..100] of Char; begin StrPcopy(p1, 'CALC'); if GetModuleHandle(p1) = 0 then begin StrPcopy(p2, 'C:\windows\Calc.exe'); w1 := WinExec(p2, SW_Restore); end; end;