pedram
pedram

Reputation: 3767

how to start this process

I want to know how can I start this process wiht C# :

TestFile.exe -i "c:\Program Files\My App\MyContextMenuExtension.dll" "c:\Program Files\My App\LogicNP.EZShellExtensions.dll" 

How can I send that two argumant toprocess ?

Upvotes: 0

Views: 748

Answers (2)

Wildhorn
Wildhorn

Reputation: 932

Process.Start("TestFile.exe", @"-i \"c:\Program Files\My App\MyContextMenuExtension.dll\" \"c:\Program Files\My App\LogicNP.EZShellExtensions.dll\"");

Dont forget the path in first parameter. Second parameter is your arguments, each separated by a space (if there is space in your arguments, you need to put them inbetween \"

Upvotes: 1

Justin Niessner
Justin Niessner

Reputation: 245419

string arguments = 
    "-i \"c:\\Program Files\\My App\\MyContextMenuExtension.dll\"";

arguments += " \"c:\\Program Files\\MyApp\\LogicNP.EZShellExtensions.dll\"";

System.Diagnostics.Process.Start("TestFile.exe", arguments);

Upvotes: 1

Related Questions