It not execute the command if you use the silent operator @.
For example:
Code: Select all
@call vol
Code: Select all
call @vol
This can be used as another way of write a single line comment
Code: Select all
call @ Single line comment
Moderator: DosItHelp
Code: Select all
@call vol
Code: Select all
call @vol
Code: Select all
call @ Single line comment
Code: Select all
@echo off
echo %time%
for /l %%a in (1,1,1000000) do rem
echo %time%
echo.
echo %time%
for /l %%a in (1,1,1000000) do call @ this is a comment
echo %time%
pause
Code: Select all
14:49:04.92
14:49:06.18
14:49:06.18
14:50:37.22
Press any key to continue . . .
Yes - that is known behavior. We documented that in Phase 6 of the batch parsing rules at StackOverflow. There are a number of constructs that function as a REM if combined with CALL.
There are other Phase 6 peculiarities that I omitted above. Read the StackOverflow post for more info.StackOverflow wrote: Phase 6) CALL processing/Caret doubling: . . .
- . . .
- Remove the first CALL so multiple CALL's can be stacked
- . . .
- Restart phases 1, 1.5, and 2, but do not continue to phase 3
- . . .
- Phase 2 tasks are altered a bit
- . . .
- The CALL is aborted without error if any of the following are detected
- Newly appearing unquoted, unescaped & or |
- The resultant command token begins with unquoted, unescaped (
- The very first token after the removed CALL begins with @
- . . .