Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Clear all Windows Event logs

Tags: clear log command

Generally you do not need to Clear Windows event logs as they contain important information to troubleshoot any issues.

If you ever need to clear specific event logs, you can always do it via GUI and you can take the backup of the event logs before clearing them. Following are the steps to clear them using Windows Event Viewer:

Windows Event Viewer

  1. Start Event Viewer.
  2. In the console tree, navigate to the event log you want to clear.
  3. On the Action menu, click Clear Log.
  4. You can either clear the event log or save a copy of the event log and then clear it.
    • To clear the event log without saving: Click Clear.
    • To clear the event log after saving: Click Save and Clear, type a name for the saved file in File name on the Save As dialog box and click Save.

You can also clear Event logs using Windows Command as follow:

wevtutil cl log_file_name [/bu: backup_file_name]

The following example clears all the events from the Application log after saving them to C:\administrator\backups\bak_application0101.evtx:

wevtutil.exe cl Application /bu:C:\administrator\backups\bak_application0101.evtx

Command line requires to specify log_file_name. You can obtain it using the following command:

wevtutil el

The above command will list all log files name.

If you wish to clear all event logs without backup, you can use the following command:

for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1"

Please note that the above command will clear all event logs without backup. So be careful while executing the above command.



This post first appeared on Web Hosting Blog - Web Hosting Discussion, please read the originial post: here

Share the post

Clear all Windows Event logs

×

Subscribe to Web Hosting Blog - Web Hosting Discussion

Get updates delivered right to your inbox!

Thank you for your subscription

×