Running Commands through Process class

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
 
M

Marc Gravell

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top