更新时间:2023-12-04 13:01:22
使用 set
和 / p
参数,你可以不用换行符来回显:
C:\> echo Hello World
Hello World
C:\> echo | set / p =Hello World
Hello World
C:\>
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.
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:\>