mitchellt
mitchellt

Reputation: 1012

C# ProcessStartInfo: how to specify filepath?

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

Thanks.

Upvotes: 7

Views: 17831

Answers (2)

evanmcdonnal
evanmcdonnal

Reputation: 48076

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.

Upvotes: 13

Vadim
Vadim

Reputation: 17957

use Process.StartInfo.WorkingDirectory or just specify the full path of the file name.

Upvotes: 4

Related Questions