I am trying to comment out some useful hints. I followed this Stack Overflow page to apply the most defensive comment - using double quotes. Comment error. But I still get error
This is my simple script: test_comment.cmd
@echo off
:: " %~nI - expands %I to a file name only "
:: " %~xI - expands %I to a file extension only "
for /F "delims=" %i in ("c:\foo\bar baz.txt") do @echo %~nxi
This is the error I got when I run it
>test_comment
The following usage of the path operator in batch-parameter
substitution is invalid: %~nI - expands %I to a file name only "
For valid formats type CALL /? or FOR /?
The syntax of the command is incorrect.
If I removed those two commented lines, error would disappear; so that I know the comment didn't work.
How should I comment out those two lines?
I really don't want to delete them.
I am using windows 10, latest patch, default cmd.exe.