Example:
test.bat
Code: Select all
dir C:\Temp
Contents of C:\Temp-----Test1, Test2, Test3
Command Line:
test.bat > output.txt --> Place output in txt file and I would also like the results to be displayed on the screen at the same time.
Moderator: DosItHelp
Code: Select all
dir C:\Temp
Code: Select all
@echo off &setlocal
>output.txt type nul
for /f "delims=: tokens=1*" %%a in ('dir C:\Temp^|findstr /n "^"') do (
>>output.txt echo.%%b
echo.%%b
)
pause