title: How to get the current line number?
body: <p>I'm trying to build a generic batch file that can tell errors with a line number, where the error occours.<br>
  But writing each line number in the code is a little bit annoying.</p>
  
  <p>Is it possible to get the current line number, while a batch-file is running?<br>
  So that the following code can work?</p>
  
  <pre><code>@echo off
  call :doSomething 1
  
  if %errorlevel% GTR 0 (
      REM Do something magic, to retrieve the lineNo
      call :getCurrentLineNo currentLineNo
      echo Error near %currentLineNo%
  )
  
  call :doSomething 2
  
  if %errorlevel% GTR 0 (
      call :getCurrentLineNo currentLineNo
      echo Error near %currentLineNo%
  )
  </code></pre>