Starting a process with multiple arguments

  • Thread starter Thread starter CroDude
  • Start date Start date
C

CroDude

Hi all!

Please help me with this, I'm stuck here.
I have a command line .exe file which needs a few arguments passed to do
it's job.

In help there's a example like this:

Process.Start("notepad.exe", "something.txt");

This is ok, but what if I must supply .exe with multiple arguments.
Something like this:

PTStitcher -o outputpano script.txt imagein

Real example:
PTStitcher.exe -o c:\path\pic.tif script.txt c:\path\pic01.jpg

How to pass this four arguments to PTSctitcher.exe ?

Thanks in advance!
 
Hi CroDude,

Create an instance of Process and set it's StartInfo property, something
like this:

Process ptStitcher = new Process();

ptStitcher.StartInfo.FileName = "PTStitcher.exe";
ptStitcher.StartInfo.Arguments = "-o c:\path\pic.tif script.txt
c:\path\pic01.jpg";

ptStitcher.Start();

Joe
 
Thanks Joe! That helped!


Joe Mayo said:
Hi CroDude,

Create an instance of Process and set it's StartInfo property, something
like this:

Process ptStitcher = new Process();

ptStitcher.StartInfo.FileName = "PTStitcher.exe";
ptStitcher.StartInfo.Arguments = "-o c:\path\pic.tif script.txt
c:\path\pic01.jpg";

ptStitcher.Start();

Joe
 
Back
Top