I am running a command from the CMD via a batch file like so..
echo Step 3. Check TNSPING
tnsping vtdbs 2>NUL
if not errorlevel 1 set error=PASSED
if errorlevel 1 set error=FAILED
echo Result: %error%
But this only tells me if it actually was able to run the command.. When this command is ran it will give an output like so..
blah blah blah
blah blah blah
blah blah
blah blah
blah blah
blah blah
blah blah
OK (80 msec)
So line 8 should say "OK" and as long as it does then.. echo RESULT: Passed
else echo RESULT: Failed
But not sure how to check and see if 8th line is .."OK"