Windows batch: echo without new line

gregseth picture gregseth · Aug 18, 2011 · Viewed 254.5k times · Source

What is the Windows batch equivalent of the Linux shell command echo -n which suppresses the newline at the end of the output?

The idea is to write on the same line inside a loop.

Answer

arnep picture arnep · Aug 18, 2011

Using set and the /p parameter you can echo without newline:

C:\> echo Hello World
Hello World

C:\> echo|set /p="Hello World"
Hello World
C:\>

Source