It’s possible to run commandline in c# by using something like this :
process = new Process();
process.StartInfo.FileName = command;
process.Start();
The problem is if the command string contains parameters, for example:
C:\My Dir\MyFile.exe MyParam1 MyParam2
This will not work and I don’t see how to extract the parameters from this string and set it on the process.Arguments property? The path and filename could be something else, the file does not have to end with exe.
How can I solve this?
If I understand correctly I would use:
If you have a complete string that you need to parse I would use the other methods put forward by the others here. If you want to add parameters to the process, use the above.