how can i output two echo command in one line
how can i echo this code in one line
Code: Select all
echo this file & del /q file.txt && echo deleted successfuly.
output example
Code: Select all
this file deleted successfuly.
Moderator: DosItHelp
Code: Select all
echo this file & del /q file.txt && echo deleted successfuly.
Code: Select all
this file deleted successfuly.
Code: Select all
@echo off
chdir /d "%~dp0"
set "scr=%~dp0\_cho.scr"
echo N _CHO.COM> "%scr%"
echo E 0100 BB 80 00 43 80 3F 0D 75 FA C6 07 24 B4 09 BA 82>> "%scr%"
echo E 0110 00 39 DA 7F 02 CD 21 B4 4C CD 21>> "%scr%"
for %%s in (RCX 001B W Q) do echo %%s>> "%scr%"
debug< "%scr%" >nul
del "%scr%" /q
_cho.com %date%
_cho.com . test first word
_cho.com . test second word.
pause >nul
allal wrote:thanks it really works but when i run the below code the cmd window very fastly get resized and resized until the code ends
Code: Select all
<nul set /p ".=Line1-"
echo This is appended to Line1
jeb wrote:allal wrote:thanks it really works but when i run the below code the cmd window very fastly get resized and resized until the code ends
The debug command resizes the window, perhaps also the _cho.com (didn't test this).
You can also use simple batch syntax to echo into the same lineCode: Select all
<nul set /p ".=Line1-"
echo This is appended to Line1
jeb
Code: Select all
@echo off
(<nul set/p=Hello )&(>nul ping 1.1.1.1 -n 1 -w 2000)&echo world!
Code: Select all
Hello world!
Code: Select all
@echo off
set "echoNoLF=<nul set/p="
(%echoNoLF%Hello )&(>nul ping 1.1.1.1 -n 1 -w 2000)&echo world!
Code: Select all
@echo off
set "echoNoLF=<nul set/p="
set "pin=>nul ping 1.1.1.1 -n 1 -w 2000"
(%echoNoLF%No thanks )&(%pin%)&(%echoNoLF%No credit )&(%pin%)&(%echoNoLF% this )&(%pin%)&(%echoNoLF% dumb )&(%pin%)&(%echoNoLF% nature )&(%pin%)&(%echoNoLF% asks )&(%pin%)&(%echoNoLF% for )&(%pin%)&(%echoNoLF% nothing )&(%pin%)&echo in return
pause