Comments in AutoIt

Reference on how to write single-line and block comments in AutoIt.

Comments in AutoIt are written either using semicolon, or #comments-start and #comments-end. Comments are useful when you want to describe your code, do try not to overdo it however. Don't just use comments to state the obvious.

Comments can also be useful for beginners learning AutoIt, when used as small reminders about their code.

AutoIt Comments Example

The below is a demonstration of how to write a Block Comment in AutoIt.

#comments-start
  MsgBox(4096, "", "This message box has been commented out, and should not be displayed when the script is run.")
#comments-end

To write single-line comments, use the semicolon, like demonstrated below.

 ; MsgBox(4096, "", "This message box has been commented out, and should not be displayed when the script is run.")

Abbreviated Keywords

You can also use #cs and #ce to write block comments.

#cs
  Just a test comment

  MsgBox(4096, "", "This message box has been commented out, and should not be displayed when the script is run.")
#ce