ShellExecute(0, 'open', PChar('b.exe'), '', '', sw_ShowNormal);

解决方案 »

  1.   

    我见过你说的问题,论坛上就有,方法是生成一个 .bat(自动批处理) 文件,先让自己执行,在删除可执行文件(。EXE)病毒^_^,请自己搜索一下。
      

  2.   

    //bbat.bat
    @b.exe//a.exe
    begin
    if application.MessageBox(pchar('客户端最新版本为' + ServerVer + ',请立即更新!'), '提示', mb_YesNo + mb_IconQuestion) = Id_Yes then
    begin
    ShellExecute(handle, 'open', PChar('bbat.bat'), '', '', sw_hide);
    application.Terminate;
    end;
    end;
      

  3.   

    a common trick to make a program self-destruct is to have it write a tiny
    batch file, and, as the very last thing it does before closing, starting
    this batch file with a
    //*************************************
       winexec(batchfilename, SW_HIDE );
    //*************************************
    The batch deletes the program and then can delete itself. The last line is adel %0and it is *not* terminated with a carriage return/line feed pair.