Guys,
this worked...
private void ExecuteSrecCommand(String strCommand)
{
ProcessStartInfo commandInfo = new ProcessStartInfo();
commandInfo.WorkingDirectory = @"D:\\TOOLS\\srecord-1.63-win32";
commandInfo.CreateNoWindow = true;
commandInfo.UseShellExecute = false;
commandInfo.RedirectStandardInput = false;
commandInfo.RedirectStandardOutput = false;
commandInfo.FileName = "cmd.exe";
commandInfo.Arguments = strCommand;
Process process = Process.Start(commandInfo);
process.Close();
}
Now, there is another problem.
the above code opens the command prompt and executes the command.
But, the process.Close() doesn't closes/deletes the command prompt. In Task manager, I can see many instances of Command prompt are open.
I tried to close the commandInfo but commandInfo.Close doesn't exist :(
Please let me know, how to close the command prompt while exiting the function.