Groups | Blog | Home
all groups > c# > march 2007 >

c# : Running Commands through Process class


Shilpa
3/13/2007 11:19:27 PM
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
Marc Gravell
3/14/2007 12:27:18 AM
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
AddThis Social Bookmark Button