Home:ALL Converter>Run commands on command line not working as expected

Run commands on command line not working as expected

Ask Time:2018-12-04T10:40:31         Author:TermSpar

Json Formatter

I'm just trying to know how to run commands on the command line in C#, I've browsed just about every forum on this topic and all have something like this:

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = "echo hello";
process.Start();

Yet when I type it in, all that shows up is a command prompt with the project directory. The command is never executed.

Author:TermSpar,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/53604938/run-commands-on-command-line-not-working-as-expected
yy