[SOLVED] Console output to text file missing entries.
Posted: 03 Aug 2020 13:17
Good evening everyone.
I have this cmd . . .
When I run it, it outputs the list and any ERRORS to the console, great so far!
I put that in a separate .bat file and called it from another .bat file because I just wanted to create a .txt file on the desktop rather than having it run in the console . . .
The .txt file is great, EXCEPT the errors are shown on the screen [ ONLY the errors btw ], but NOT in the .txt file.
I added 2>nul to stop the errors showing in the console, but they still don't show in the .txt file.
I basically want everything that gets output to the console as per the first piece of code, including the errors, output to a .txt file.
Thanks in advance.
I have this cmd . . .
Code: Select all
for /f "tokens=*" %%i in ('wevtutil.exe el') do echo "%%i" & wevtutil.exe cl "%%i" & wevtutil.exe cl System
I put that in a separate .bat file and called it from another .bat file because I just wanted to create a .txt file on the desktop rather than having it run in the console . . .
Code: Select all
call "%~dp0bin\Events.bat" > "%userprofile%\desktop\Event.txt"
I added 2>nul to stop the errors showing in the console, but they still don't show in the .txt file.
I basically want everything that gets output to the console as per the first piece of code, including the errors, output to a .txt file.
Thanks in advance.