From a2dd6404cb544cf030e0ada97c57dea4611c0975 Mon Sep 17 00:00:00 2001 From: wyattscarpenter Date: Fri, 27 Sep 2024 02:33:55 -0700 Subject: [PATCH] add # comment macro for cmd --- set-comment-macros.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/set-comment-macros.bat b/set-comment-macros.bat index c3d4612..ebe1a9a 100755 --- a/set-comment-macros.bat +++ b/set-comment-macros.bat @@ -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"