请教:我想调用一个另一个exe文件,但该exe文件后面还有个参数,在DELPHI里如何调用,该程序的快捷方式是这样写的,"D:\Program \test.exe" -apptest
我怎么调用它,注意需要后面的参数!

解决方案 »

  1.   

    ShellExecute(Handle, nil, PChar('D:\Program \test.exe - -apptest'), nil, nil, SW_SHOWNORMAL)
      

  2.   

    http://www.codebake.com/windowsexec.php也可:
    ShellExecute(Handle, nil, PChar('D:\Program \test.exe'), pchar('-apptest'), nil, SW_SHOWNORMAL)
      

  3.   

    UINT WinExec( LPCSTR lpCmdLine, file://命令行指针 UINT uCmdShow file://应用程序的窗口风格);procedure TForm1.Button1Click(Sender: TObject);varstr: string;beginstr :="D:\Program \test.exe" -apptest;winexec(PChar(str), SW_SHOWNORMAL); file://启动指定的可执行程序
    end;
      

  4.   

    不是ShellExecute就是WinEXEC,最多CreateProcess了
      

  5.   

    winexec(PChar(filename), SW_SHOWNORMAL);
      

  6.   

    WinExec就OK了,具体可以看API帮助。
      

  7.   

    winexec(PChar(filename), SW_SHOWNORMAL);