In Bash, # is used to comment the following. How do I make a comment on the Windows command line?
相关问题
- Inheritance impossible in Windows Runtime Componen
- how to get running process information in java?
- Is TWebBrowser dependant on IE version?
- How can I have a python script safely exit itself?
- I want to trace logs using a Macro multi parameter
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Bundling the Windows Mono runtime with an applicat
- Windows 8.1 How to fix this obsolete code?
- Compile and build with single command line Java (L
- CosmosDB emulator can't start since port is al
- How to print to stdout from Python script with .py
A comment is produced using the REM command which is short for "Remark".
As a result:
It's "REM".
Example:
The command you're looking for is
rem
.There is also a shorthand version
::
, which sort of looks like#
if you squint a bit and look at it sideways :-) I originally preferred the::
variant since I'm abash
-aholic and I'm still trying to forget the painful days of BASIC.Unfortunately, there are situations where
::
stuffs up the command line processor (such as within complexif
orfor
statements) so I generally userem
nowadays. In any case, it's a hack, suborning the label infrastructure to make it look like a comment when it really isn't.You should also keep in mind that
rem
is a command so you can't just bang it at the end of a line like the#
inbash
. It has to go where a command would go. For example, only the second of these two will echo the single wordhello
:Lines starting with "rem" (from the word remarks) are comments:
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:
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.