知道了文件的路径,如何运行这个文件?
比如,知道a.exe的路径为d:\a.exe,如何在程序运行这个程序?
望高手指点,在此先谢谢啦!

解决方案 »

  1.   

    CreateProcess
    ShellExecute
    system哪个都可以。查查MSDN研究看看吧
      

  2.   

    HINSTANCE ShellExecute(          HWND hwnd,
        LPCTSTR lpOperation,
        LPCTSTR lpFile,
        LPCTSTR lpParameters,
        LPCTSTR lpDirectory,
        INT nShowCmd
    );
    lpFile表示你的程序路径
    或者
    WINSHELLAPI BOOL WINAPI ShellExecuteEx(
      LPSHELLEXECUTEINFO lpExecInfo 
    );
    路径在lpExecInfo 结构体里面包含着。
      

  3.   

    CString   path="d:\\a.exe";   
      WinExec(path,SW_SHOWNORMAL);
      

  4.   

    谢谢各位,
    CreateProcess 的参数怎那么复杂啊,看那英语都要晕了,
    最后用ShellExecute搞定了,
    弱弱的问句,msdm有全中文的吗?