What is the command to check if a command's results mention OK?

Posted by Manuel on Super User See other posts from Super User or by Manuel
Published on 2012-06-12T03:28:37Z Indexed on 2012/06/12 4:42 UTC
Read the original article Hit count: 419

Filed under:
|
|

Alright, so I was playing around with changing MTU size and wanted to make a batch file to automatically lower it and then raise it later.
This is probably simple, but I just can't figure it out. Point is, is there a way to run a command, which would normally echo out "ok" but check to see if it does say ok? And if it doesn't say ok then, to end the rest of the file from running and exit out.
The command I'm using is netsh interface ipv4 set subinterface "Local Area Connection" mtu=386 store=persistent which, as I mentioned above prints out an OK. I just want to check if it did run correctly, and if not, then do __

© Super User or respective owner

Related posts about Windows

Related posts about command-line