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 t
Using: echo | set /p=
or
However, this can be very dangerous when writing more advanced scripts when checking the ERRORLEVEL becomes important as setting set /p=
without specifying a variable name will set the ERRORLEVEL to 1.
A better approach would be to just use a dummy variable name like so:
echo | set /p dummyName=Hello World
This will produce exactly what you want without any sneaky stuff going on in the background as I had to find out the hard way, but this only works with the piped version;