2012-09-24 50 views
0

(例如靜音模式),我在這個應用程序,我想以靜默方式運行另一個exe文件的vb.net Windows應用程序,這個第一我已經運行在命令行這個exe文件是working.But我不知道如何通過vb.coding的Process.Start通過這些參數。如何命令行參數傳遞給.exe文件使用的Process.Start

通過命令行我已經通過像這樣。 d:\安裝MyApps> SAMPLE.EXE/S/V/QN(工作正常)

而是通過編碼我有過這樣的

Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)) 
     Dim info As New System.Diagnostics.ProcessStartInfo 
     info.FileName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\sample.exe" 
     info.Arguments = "/s /v/qn" 
     Dim process As New System.Diagnostics.Process 
     process.StartInfo = info 
     process.Start() 
     MessageBox.Show(info.Arguments.ToString()) 
     process.Close() 

這是行不通的什麼是錯的這個代碼請幫助我..

回答

5
Process.Start("D:\myapps\sample.exe", "/s /v/qn") 
+0

謝謝sss ..其實我已經嘗試這個在第一次,但它無法運行that.But當我第二次運行它工作正常.. –

相關問題