How do I comment on the Windows command line?

后端 未结 7 866

In Bash, # is used to comment the following. How do I make a comment on the Windows command line?

7条回答
  •  一个人的身影
    2020-12-23 13:32

    Sometimes, it is convenient to add a comment to a command line. For that, you can use "&REM misc comment text" or, now that I know about it, "&:: misc comment text". For example:

    REM SET Token="4C6F72656D20697073756D20646F6C6F" &REM This token is for localhost
    SET Token="722073697420616D65742C20636F6E73" &REM This token is for production
    

    This makes it easy to keep track of multiple sets of values when doing exploration, tests of concept, etc. This approach works because '&' introduces a new command on the same line.

提交回复
热议问题