for /f %%a in ( C:\LOGLIST.TXT ) do WEVTUTIL CL "%%a"
The textfile is created from WEVTUTIL EL >>C:\LogList.txt
For example, this:
Internet Explorer
will fail with error
Failed to clear log Internet.
The specified channel could not be found.
Whereas
HardwareEvents
Will work fine. Only happens when channel name has a space.
Any ideas why?
WEVTUTIL CL fails if the event log channel has a space in it
Moderator: DosItHelp
Re: WEVTUTIL CL fails if the event log channel has a space in it
If you don't use any arguments in your "for/f"-loop, then the default setting is used, which is the first token (for more, see "for/?" - without the doublequotes).
This might help you:
penpen
This might help you:
Code: Select all
for /f "usebackq tokens=* delims=" %%a in ("C:\LOGLIST.TXT") do WEVTUTIL CL "%%a"
Re: WEVTUTIL CL fails if the event log channel has a space in it
That works. Thanks for your help.