echo message without line break

  • Thread starter Thread starter Thomas Wiedmann
  • Start date Start date
T

Thomas Wiedmann

Hello,

is there a chance (option) to render an echo output by command or cmd file
which is not finished by a line break, but allows entering further text in
the same line as the echo output - if yes, by which statement or option?

Thomas Wiedmann
 
Thomas Wiedmann said:
Hello,

is there a chance (option) to render an echo output by command or cmd file
which is not finished by a line break, but allows entering further text in
the same line as the echo output - if yes, by which statement or option?

Thomas Wiedmann

There probably is but you need to supply further details. What exactly do
you wish to achieve? Prompt the user for some input, then add something to
this input? Write some text to the console or to a file without a
terminating CRLF?
 
There probably is but you need to supply further details. What exactly do
you wish to achieve? Prompt the user for some input, then add something to
this input?
Yes, exactly
Write some text to the console or to a file without a terminating CRLF?
Yes, and also that case.


Thomas Wiedmann
 
Thomas Wiedmann said:
Yes, exactly

Yes, and also that case.


Thomas Wiedmann

To prompt the user for some input, then add something to this input:
@echo off
set /p Name=Please enter your name
echo Hello, %Name%, how is the weather today?

To write text to the console without a terminating CRLF:
@echo off
set Line=The quick brown fox
for /F "delims=" %%a in ('echo %Line%') do <nul>outfile.txt set /p =%%a
 
Thomas said:
is there a chance (option) to render an echo output by command or cmd file
which is not finished by a line break, but allows entering further text in
the same line as the echo output - if yes, by which statement or option?

The internal 'echo' command always appends a newline sequence at the end
of its output. You will have to do the string concatenation before you
submit the string using an 'echo' command.
 
Back
Top