1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? A very simple question re. the current line number in a batch file...

Discussion in 'Support' started by mathewsdw, Mar 5, 2012.

  1. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Is there any way to get the line number of the currently executing statement in a batch file? Something like "blah blah blah error on line 25 in batch file abcdef", for instance. I was thinking something like an internal variable ("%_LineNumber", for example) but searching the docs I'm not finding anything...

    - Dan
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,523
    Likes Received:
    4
  3. mathewsdw

    Joined:
    May 24, 2010
    Messages:
    855
    Likes Received:
    0
    Thank you, Steve, I'm laughing as I type this!:) I figured it was something as simple as that but I honestly would never have guessed "_batchline". Makes total sense in hindsight, however. Thanks again!
     

Share This Page