[問題] 關於外部執行檔

看板C_Sharp (C#)作者 (啪)時間18年前 (2007/07/24 22:46), 編輯推噓1(103)
留言4則, 2人參與, 最新討論串1/1
如果我想執行c:下的一個檔案aut.exe 後面的參數必須是b.txt -n -o a.txt (在cmd執行的時候必須要打 aut b.txt -n -o a.txt) System.Diagnostics.ProcessStartInfo p = new System.Diagnostics.ProcessStartInfo(@"c:\\aut.exe","b.txt -n -o a.txt"); p.Arguments = ; // System.Diagnostics.Process.Start(p); 我不太知道怎樣用 會的人可以指導一下嗎@@ google的看的都不太瞭 另一種看別人先用cmd的是 System.Diagnostics.ProcessStartInfo p = new System.Diagnostics.ProcessStartInfo("cmd"); p.Arguments = @"/c ""C:\autotag C:\b.txt -n -o C:\a.txt"""; 不過也不行@@?我用錯還是我搞錯了嗎 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.166.98.180

07/25 05:24, , 1F
@"C:\\autotag.exe" => @"C:\autotag.exe"
07/25 05:24, 1F

07/25 11:31, , 2F
不行捏
07/25 11:31, 2F
※ 編輯: qweqweqweqwe 來自: 218.166.105.221 (07/25 11:33)

07/25 11:40, , 3F
qq原來是少了p.WorkingDirectory=@"c:\";
07/25 11:40, 3F

07/25 11:40, , 4F
自問自答一下QQ
07/25 11:40, 4F
文章代碼(AID): #16fX3EDf (C_Sharp)
文章代碼(AID): #16fX3EDf (C_Sharp)