HI,
i am trying to execute .jwg file from c# code.
it requires RunAs Admin for cmd prompt.
I need the output after this test case execute. Either Passed or failed.
Please guide me for the steps.
Below is my Code. Please let me know if i am missing anything.
ProcessStartInfo procStart = new ProcessStartInfo("cmd.exe", @"C:\Users\mohammed_ahmed4\Desktop\TestCases\1173275\1173275.jwg");
Process process = new Process();
process.StartInfo = procStart;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.Start();
process.WaitForExit();
string output = process.StandardOutput.ReadToEnd();
string error = process.StandardError.ReadToEnd();
Console.WriteLine("output >>" + (String.IsNullOrEmpty(output) ? "(none)" : output));
Console.WriteLine("error>>" + (String.IsNullOrEmpty(error) ? "(none)" : error));
process.Close();
I am getting the error . i.e, 'ls' is not recognized as an internal or external command, operable program or batch file. windows