I guess what I'm saying is that you probably dont have to read the command line ... whatever program is displaying that (what looks like) an error message, is probably also setting the value of @ERROR, and you may be able to check that instead (basically make it easier on yourself).