in reply to Re^3: getting line count in cmd.exein thread getting line count in cmd.exe
My error was in failing to unwrap lines.
Meh; duh!
Thanks for putting me on the right track.