I would like to execute Command Prompt(CMD) programmatically and then execute a series of commands and check if the commands return success or failure.

I have seen how to execute a batch file or general commands but how can I catch the errors and carry on with further commands in the same window.

Like,

> 
> DiskRaid
> 
> 
> 
> > 
> > create
> > 
> > 
> > list
> > 
> > 
> > select
> > 
> > 
> > name
> > 
> > 
> > extend
> > 
> > 
> > detail
> > 
> > 
> > 
> 
> 
> 

And if any of the above commands return an Error, I have to store the error and proceed with other operations. So that at the end, I can easily figure out which commands went through successfully and which failed.

Any idea of how this can be implemented using C# or C++?