Echo Parentheses

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
lmstearn
Posts: 50
Joined: 07 Dec 2014 15:15
Location: Australia
Contact:

Echo Parentheses

#1 Post by lmstearn » 30 Jul 2024 09:32

Curious about the usage of the newline separator in the block - the closest search hit was in ECHO. FAILS to give text or blank line - Instead use ECHO/ thread

Code: Select all

@echo off
echo(
Setlocal EnableDelayedExpansion
set NL=^
SET /P Text="First Line!NL!Second Line!NL!"
if /I !Text!==f goto FIRST
if /I !validateText!==s goto SECOND
goto ENDSCRIPT
:FIRST
:SECOND
@echo off
Although it's very easy in this case not to worry about the escape character assignment, just inserting echo First Line at the top of the script, are any valid alternatives with a newline separator together with echo( recommended?
Thanks. :)

Post Reply