Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# ProcessStartInfo: how to specify filepath?

Tags:

c#

process

I can see that in ProcessStartInfo you can specify a file name, but how do you specify a file path?

Thanks.

like image 708
mitchellt Avatar asked Dec 09 '22 11:12

mitchellt


1 Answers

When it says "filename" it means full or relative path to the file. So you could do something like @"C:\program files\my folder\myProcess.exe"; for example. Or @".\..\..\MyRelativePathedProcess.exe"; You can also control the CWD with Process.StartInfo's WorkingDirectory property.

like image 118
evanmcdonnal Avatar answered Dec 11 '22 00:12

evanmcdonnal