@LINES[filename]:  Returns the line number of the last line in the file, or "-1" if the file is empty. The first line in the file is numbered 0, so (for example) @LINES will return 0 for a file containing one line. To get the actual number of lines, use %@INC[%@LINES[filename]].


The filename must be in quotes if it contains white space or special characters.


@LINES must read each line of the file in order to count it, and will therefore cause significant delays if used on a large file.


@LINES can count lines in file streams on NTFS drives if the stream name is specified. See NTFS File Streams for additional details on file streams.


@LINES also sets two command variables:


%_LINES_MAXLENThe length of the longest line (in characters)
%_LINES_MAXLOCThe line number (base 0) of the longest line




echo %@lines[readme.txt]