Skip to content

Commit

Permalink
add # comment macro for cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattscarpenter committed Sep 27, 2024
1 parent 48cc7fc commit a2dd640
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion set-comment-macros.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
REM This batch script sets cmd autorun to use doskey to make // a macro for the REM (remark, ie comment) command. Note that it does this very poorly, because //foo doesn't work as a comment.

reg add "HKCU\Software\Microsoft\Command Processor" /v Autorun /d "doskey //=REM"
reg add "HKCU\Software\Microsoft\Command Processor" /v Autorun /d "doskey //=REM && doskey #=REM"

REM Alias REM and // to be comments in powershell (perhaps we could call this a pseudo-comment). I don't think side-effects in the commented expressions evaluate, which is nice. Also note that // must be followed by a space. The comment-ness will be terminated by ;, &&, etc, unfortunately.
powershell "echo 'Function // { }' >> $profile"
Expand Down

0 comments on commit a2dd640

Please sign in to comment.