How to pass command line arguments to the .exe file (e.g silent mode) using process.start

Victor Athoti. picture Victor Athoti. · Sep 24, 2012 · Viewed 21.4k times · Source

I have an vb.net windows application in this application i want run another exe file in silent mode,for this first i have run this exe file in command line it is working.But i don't know how to pass the these arguments through vb.coding process.start .

through command line i have pass like this. D:\myapps>sample.exe /s /v/qn (working fine)

but through coding i have pass like this

 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()

this is not working what is wrong with this code please help me..

Answer

SSS picture SSS · Sep 24, 2012
Process.Start("D:\myapps\sample.exe", "/s /v/qn")