_BATCHLINE returns the current line number in the current batch file. It is -1 if no batch file is active.

 

The first line in the batch file is numbered 1.