In Bash, # is used to comment the following. How do I make a comment on the Windows command line?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The command you’re looking for is
rem, short for "remark".There is also a shorthand version
::that some people use, and this sort of looks like#if you squint a bit and look at it sideways. I originally preferred that 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 complexiforforstatements) so I generally useremnowadays. In any case, it’s a hack, suborning the label infrastructure to make it look like a comment when it really isn’t. For example, try replacingremwith::in the following example and see how it works out:You should also keep in mind that
remis 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, the first line below outputs allhello rem a commentbut the second outputs the single wordhello:The second is two separate commands separated by
&, and with no spaces before the&because echo will output those as well. That’s not necessarily important for screen output but, if you’re redirecting to a file, it may: