Wednesday, April 29, 2009

How to pass the value when call exe in another application in .NET

Hi Guys,

I seem in forums lot's of the developer asking how to pass the arguments when they call exe within the another application in.NET. is quite easy.

Code

C#:

Process process = new Process();
process.StartInfo = new ProcessStartInfo("abc.exe");
process.StartInfo.Arguments = "folderpath "; // if you need suply multiple arguments you need put space "A B"
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();

VB.NET:

Dim process As New Process()
process.StartInfo = New ProcessStartInfo("abc.exe")
process.StartInfo.Arguments = "folderpath "
' if you need suply multiple arguments you need put space "A B"
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
process.Start()

Thank you
Keep It Watch

No comments:

Post a Comment