Running Commands through Process class

  • Thread starter Thread starter Shilpa
  • Start date Start date
S

Shilpa

Hi,

I am trying to run a command line using the Process class.
The command has to be run from a particular directory (say C:\XYZ),
ie., if I open the command prompt, I should be in C:\XYZ to run my
command as it has many dependencies.
How do I achieve this using the Process class? Is there any other
alternative?

Regards,
Shilpa
 
At a guess (never tried it), create a ProcessStartInfo and set the
WorkingDirectory (as well as the args, path, etc) - and use this
(rather than just the exe name) to start the process.

Marc
 
Back
Top