Use batch cleanup to clear Event Viewer code for all Windows eventlog logs _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 approach eats all Windows systems in principle, but I only test them on Windows 2008 R2, so at least Vista versions should be available.
Write so much is to SEO, the following for the body, save for WindowsEventLog.ClearAll.cmd double click Execute:

Copy Code code as follows:

@ECHO off
TITLE Clear all Event Viewer to see the EventLog log, Midway prompts error do not pay attention to
ECHO.
ECHO Liu YONGFA 2012-1-29 12:05:30
ECHO.
for/f%%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.