I stumbled across this the other day:
Code: Select all
(cmd /d /u /c type nul >con
echo(first
echo(second
echo(third)
Only the first echo is displayed. The other two are suppressed.
Can anyone explain what’s going on here?
TIA!
- SB
Moderator: DosItHelp
Code: Select all
(cmd /d /u /c type nul >con
echo(first
echo(second
echo(third)
Output wrote:first##second##third
Redirected file wrote:first
second
third
Code: Select all
>con cmd /C echo first&echo second&echo third
Code: Select all
>a2z.txt echo(the quick brown fox jumps over the lazy dog
Code: Select all
cmd/d /u /c type a2z.txt >con
Code: Select all
for /f delims^=^ eol^= %%c in ('
cmd /d /u /c type a2z.txt ^| (pause^>nul^&pause^>nul^&findstr "^"^)
') do echo(%%c