echo message without line break

  • Thread starter Thomas Wiedmann
  • 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
 
P

Pegasus [MVP]

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?
 
T

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?
Yes, exactly
Write some text to the console or to a file without a terminating CRLF?
Yes, and also that case.


Thomas Wiedmann
 
P

Pegasus [MVP]

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
 
V

VanguardLH

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top