如:程序A.exe,现在我要在程序A.exe中运行程序B.EXE,同时我需要传递多个参数,请教各位大虾,我怎么做?

解决方案 »

  1.   

    Windows怎么做,你就怎么做啊
    var
     sParam: string;
     sParam := '/s /r';
     WinExec(PChar('"B.exe"' + sParam),SW_SHOWNORMAL)
      

  2.   

    楼上得可以了
    shellExecute()也可以
      

  3.   

    在A里:
    ShellExecuteLPCTSTR lpParameters:这个就是你可以以空格格开多个参数在B:用这样来取得参数
    procedure TForm1.FormCreate(Sender: TObject);var
      i: Integer;
      for i := 1 to ParamCount do
      begin
        if LowerCase(ParamStr(i)) = 'beep' then
          Beep
        elseif LowerCase(ParamStr(i)) = 'exit' then
          Application.Terminate;
      end;
    end;