Previously, after installing the system, you had to create a Ghost. To achieve perfection, all Windows EventLog logs of the Event Viewer will be manually cleared before each Ghost operation.
Later, after using Windows 2008 r2/Win7, this incident was much more complicated, so it was no longer necessary.
Later, some colleagues asked how to clear all of them, because one by one, there are many directories at the Microsoft level. To completely clear them for half an hour, and then there is another directory after they are cleared, it is not practical.
Today, when I was playing with Hyper-V, I always saw a bunch of errors. In view of the continuous delivery that I made to the company, batch processing was very good, therefore, we thought we could use batch processing. After Google found that an international friend mentioned the method of clearing all Win7 eventlogs and wrote a screen of CMD, which was easy to understand, you have to clear all Windows eventlogs in this row.
In principle, this method can be used in all Windows systems, but I only pass the test on Windows 2008 R2, so at least Vista and later versions can be used.
Save as WindowsEventLog. ClearAll. cmd and double-click it:
Copy codeThe Code is as follows: @ ECHO OFF
TITLE: Clear EventLog logs in all Event Viewer
ECHO.
ECHO CreateBy Liuyong fa 12:05:30
ECHO ModifyBy Liu yongfa 18:10:55
ECHO.
FOR/F "delims =" % I in ('wevtutil EL ') DO (wevtutil cl "% I ")
PAUSE