1
@echo off
echo "Hello"

echo "Hello ^
my name is Florian"

I have read the post from here where it is taught that you can split a long command in MS DOS with ^ However above example does not print "Hello my name is Florian" . Instead, I get an error "Misspelled command my or the command my could not be found" What do I do wrong?

mklement0
  • 382,024
  • 64
  • 607
  • 775
user172501
  • 332
  • 2
  • 11

1 Answers1

2

Quoting forces the parser to do some things differently (see here if you like rabbit holes). So either don't use quotes or escape them:

@echo off
echo Hello ^
unquoted string
echo ^"Hello ^
quoted string^"

Output:

Hello unquoted string
"Hello quoted string"
Stephan
  • 53,940
  • 10
  • 58
  • 91