Windows batch file - The system cannot find the batch label specified

后端 未结 6 1115
孤街浪徒
孤街浪徒 2020-12-10 15:46

The Problem

I\'m having a problem with a Windows batch file and labels. I keep getting this error:

The system cannot find the batch label

6条回答
  •  我在风中等你
    2020-12-10 16:21

    The "The system cannot find the batch label specified" error message brought me here (10 years later!) and the problem turned out to be the CRLF was incorrect.

    The cause, in our case, was a Git Repository that didn't recognize BAT files as being text files which needed to be CRLF on a Windows 7 machine.

    Our solution was to create a .gitattributes file containing the line:

    *.bat text eol=crlf
    

    Then deleting the BAT files and checking out from the repository re-wrote our BAT files with the correct line endings. The BAT labels are now working again.

提交回复
热议问题