In Unix, there's this nifty binary called "lc" which gives you the line count of the file.
However, in DOS, you have to be a little more creative. Below is a DOS command I use to count the number of lines in a text file.
FIND /v /c "nonsense" filename.ext
The "nonsense" parameter is some text that is sure not to match any line in the file.