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.