Unfortunately, the errors end warnings are usually not differentiated in any way except the text of the issue. You would need to read line by line or parse the stream into lines and recognize the type of the issue report by a keyword like "Error" or "Warning" at a certain position in a line. For this purpose, you should analyze the output from a particular compiler/linker to understand its exact string format.
Some other method of such differentiation could be an error code. You can see documentation of a particular compiler/linker.
One problem you have is this: using "cmd" "/c". You never really need it. You should use immediately the command line of your application: full path name of executable file and required command line.
In practice, you usually need to run your code in a separate thread. As C or C++ compilers can work pretty slowly, you could even read the data in parallel and notify your, say, UI thread on the fly, before you read to the end. Please see my past answers on related topics:
Control.Invoke() vs. Control.BeginInvoke()[
^],
Problem with Treeview Scanner And MD5[
^],
How to get a keydown event to operate on a different thread in vb.net[
^],
Control events not firing after enable disable + multithreading[
^].
—SA