“rem” comment in .bat file causes error “25 was unexpected at this time”

后端 未结 2 1249
梦如初夏
梦如初夏 2021-01-13 15:26

Isn\'t this weird? Do .bat rem commands have some kind of escape code?

file.bat:

rem https://sourceforge.net/p/jedit/bugs/4084/?limit=25
2条回答
  •  难免孤独
    2021-01-13 15:49

    Oh, that's weird. Rem is like a regular command that answers to /? for help, even if the /? is buried somewhere in another string. I'm told that putting the address in doublequotes fixes it.

    C:\Users\admin>rem /?
    Records comments (remarks) in a batch file or CONFIG.SYS.
    
    REM [comment]
    

    Or this whole string without the 25 gives the same result:

    rem https://sourceforge.net/p/jedit/bugs/4084/?limit=
    
    Records comments (remarks) in a batch file or CONFIG.SYS.
    
    REM [comment]
    

提交回复
热议问题