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 on all Windows systems, but I only pass the test on Windows 2008 R2, so at least Vista and later versions can be used.
After writing so much, it is for SEO. The following is the body and is saved as WindowsEventLog. ClearAll. cmd. Double-click and execute:
Copy codeThe Code is as follows: @ ECHO OFF
TITLE: clears EventLog logs in all event viewers. If an error is prompted in the middle, skip this step.
ECHO.
ECHO Liu Yong fa 12:05:30
ECHO.
FOR/F % I in ('wevtutil EL ') DO (wevtutil cl % I)
PAUSE