vc中呼叫exe檔案並傳遞引數

2021-06-12 06:37:44 字數 1011 閱讀 6957

1.呼叫shell

hinstance shellexecute( hwnd hwnd,

lpctstr lpoperation,

lpctstr lpfile,

lpctstr lpparameters,

lpctstr lpdirectory,

int nshowcmd

);

?

呼叫方法 :

::shellexecute(null, "open", pszpname, "引數1 引數2 引數3", null, sw_show);
?

2.建立乙個新的程序

bool createprocess(

lptstr lpcommandline,

lpsecurity_attributes lpprocessattributes,

lpsecurity_attributes lpthreadattributes,

bool binherithandles,

dword dwcreationflags,

lpvoid lpenvironment,

lpctstr lpcurrentdirectory,

lpstartupinfo lpstartupinfo,(welcomebbs)

lpprocess_information lpprocessinformation

);

?

具體引數說明請參照msdn,另外這是windows系統原生的api,與用不用vc無關。

摘自但是不知道為什麼我的project為什麼上面提到方法試過了,都不奏效。

最後試了下system,居然一下子搞定!

system("svm-scale -s scale b-unscale.txt>b-data.txt");

表示灰常不解啊!

vc中呼叫exe檔案並傳遞引數

1.呼叫shell hinstance shellexecute hwnd hwnd,lpctstr lpoperation,lpctstr lpfile,lpctstr lpparameters,lpctstr lpdirectory,int nshowcmd 呼叫方法 shellexecute ...

C 呼叫帶引數EXE檔案及帶啟動引數EXE

一 先製作乙個帶啟動引數的exe檔案。步驟 1 定義全域性私有變數 private string s new string 1 這裡為了簡單起見,只做乙個引數 2 在窗體的建構函式中初始化啟動引數 public form1 string p 3 在main 函式中進行引數判斷 到這裡,帶啟動引數的e...

shell呼叫php指令碼,並傳遞引數

發表於 2011 07 15 分類目錄 php 一,為什麼我們要在命令列下執行php指令碼呢?個人理解,主要有二個原因 1,利用crontab去跑php,可以給伺服器減壓,當然在這裡有乙個條件,就是實時性要求不高。比如 sns中的好友動態,這個實時要求不高,但是資料量比較大,這個時候定時跑的話,會給...