Echo ( and ) within a block
Posted: 12 Aug 2025 02:46
I have this:
Output:
Ideas how to display ( and )?
ECHO/ is there just to show the problem. In reality I have a FINDSTR command and I check success/failure.
At the moment I replace '(' and ')' with '^^(' and '^^)' just for the display purposes.
Thanks.
Saso
Code: Select all
@echo off
set str=somestringABCDEF
(echo/)&&(echo %str%)
set str=somestring(ABCDEF)
(echo/)&&(echo %str%)
Code: Select all
c:\>a
somestringABCDEF
) was unexpected at this time.
c:\>
ECHO/ is there just to show the problem. In reality I have a FINDSTR command and I check success/failure.
At the moment I replace '(' and ')' with '^^(' and '^^)' just for the display purposes.
Thanks.
Saso