Purge Event Viewer of all Windows EventLog logs using the batch for command _dos/bat

Source: Internet
Author: User
Before installing the system to do a ghost, in order to achieve perfection, every time you do ghost will manually clear the Event Viewer all Windows EventLog log.

Later, after using Windows 2008 r2/win7, the incident was much more complicated, so it was out of control.
Then some colleagues asked how to clear them all, because one by one, at the Microsoft level there are many directories, to completely clean up half an hour, and then after the removal, not practical.

Today, when I play Hyper-V, I always see a pile of error, in view of the continuous delivery to the company before, batch processing, so think should be able to use batch processing to achieve, Google found an international friend has mentioned the removal of all Win7 EventLog method, Wrote a screen of CMD, to the next line, to clear all Windows eventlog methods.

This method in principle can take all the Windows system, but I only test on Windows 2008 R2 Pass, so at least vista above version should be able to use.

The following is the body, saved as WindowsEventLog.ClearAll.cmd double-click execution:

Copy Code code as follows:

@ECHO off
TITLE clears the EventLog log that is seen in all event viewers

ECHO.
ECHO createby Liu Yongfa 2012-1-29 12:05:30
ECHO modifyby Liu Yongfa 2012-9-25 18:10:55
ECHO.

for/f "delims="%%i In (' WEVTUTIL EL ') do (WEVTUTIL CL "%%i")
PAUSE
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.