banner



How To Clear Event Viewer Windows 8.1

Often when y'all want to troubleshoot bug or keep a general check on your system wellness, you have to use Event Viewer. Outcome Viewer shows yous all the Windows events that get logged such as Information, Errors, Warnings, Critical and Verbose. Simply there are and so many events here including completely normal activities that go logged that it becomes harder to spot events related to things that aren't working as expected or are causing errors. So from fourth dimension to time you may need to clear the Event Log. In this article, we will see how you tin can clear the Event log automatically or from the command line.

The Arrangement Log and the Awarding Log are ii of the important logs that you lot may desire to clear occasionally. You tin can manually articulate any Event Log by right clicking it and choosing "Articulate log..." from the right click menu. However, you lot may also want to make this automatic and so every 7 days or fifteen days, the Outcome Log gets cleared. You can also set up a scheduled job that runs automatically using ElevatedShortcut to clear the event log.

Event Log

How to clear merely a specific Upshot Log using command prompt

  1. Open up a command prompt as administrator (encounter how).
  2. To clear a specific log, you must starting time know its name. To see a list of Event Logs, blazon:
    wevtutil el

    wevtutil more

  3. This produces a very lengthy list of logs. You can apply the command: 'wevtutil el | more' (without the quotes) to display the output ane screen at a fourth dimension. Or you tin can output it to a text file using the command:
    wevtutil el > Loglist.txt

    This creates a text file Loglist.txt in the working directory of the command prompt (the same folder where y'all are currently at the command prompt).

  4. At present that you know the name of the log you want to clear, you can use the following command:
    wevtutil cl Application
  5. The higher up command clears the Awarding log. To clear the System log, use: 'wevtutil cl Organisation' (without the quotes).

How to clear all Event Logs using command prompt

  1. Open Notepad and copy-paste the following text into it:
    @echo off FOR /F "tokens=1,2*" %%V IN ('bcdedit') DO SET adminTest=%%V IF (%adminTest%)==(Access) goto noAdmin for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :do_clear "%%Thou") echo. echo Event Logs have been cleared! goto theEnd :do_clear echo clearing %one wevtutil.exe cl %ane goto :eof :noAdmin echo Yous must run this script as an Administrator! echo. :theEnd
  2. Save information technology as a batch file and give it any name you lot want for example: ClEvtLog.bat or ClEvtLog.cmd.
    Tip: To straight save a text with the .bat or .cmd extension, type the file name in quotes, that is, "ClEvtLog.bat" or "ClEvtLog.cmd".
  3. Copy this batch file to some directory to in your organisation path such as C:\Windows then you don't take to type the full path to it every time you run it.
  4. Open an elevated control prompt (come across how).
  5. Run the batch file from the command prompt: ClEvtLog.cmd. You can also directly run it without opening the command prompt or using cmd /c so the command prompt closes after running it.
    Cleared

How to clear all Event Logs using PowerShell

  1. Open PowerShell as administrator (meet how).
  2. Blazon or copy-paste the following command into PowerShell:
    wevtutil el | Foreach-Object {wevtutil cl "$_"}

    PowerShell wevtutil

  3. Press Enter. Expect for few seconds for all logs to exist cleared. You tin now go out PowerShell by typing Exit.

How to articulate all Event Logs using VBScript/WMI (archetype event logs only)

  1. Open up Notepad and copy-paste the post-obit text into information technology:
    strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate, (Backup, Security)}!\\" _ & strComputer & "\root\cimv2") Gear up colLogFiles = objWMIService.ExecQuery _ ("Select * from Win32_NTEventLogFile") For each objLogfile in colLogFiles objLogFile.ClearEventLog() Adjacent
  2. Save it as a VBScript (.VBS) file and requite it any name you lot want for case: ClEvtLog.vbs.
    Tip: To straight save a text with the .vbs extension, type the file name in quotes, that is, "ClEvtLog.vbs".
  3. Re-create this VBScript file to some directory to in your system path such every bit C:\Windows so you don't have to type the total path to information technology every fourth dimension you run it.
  4. Open an elevated command prompt (see how).
  5. Run the VBScript file from the command prompt: CScript ClEvtLog.vbs. You can besides directly run information technology without opening the command prompt or using cmd /c so the command prompt closes after running it.
    The VBScript/WMI method just clears the classic Result Logs (Application, Security, System etc, not the new XML type of event logs which are cleared by PowerShell or wevtutil.exe).

Also note that these scripts exercise not back up the logs before they are cleared. If you lot want to back up the outcome logs, look at Microsoft'due south Script Heart for samples.

Back up united states

Winaero greatly relies on your support. You lot can assistance the site proceed bringing you lot interesting and useful content and software by using these options:

If y'all similar this commodity, delight share information technology using the buttons below. It won't have a lot from you, but it volition help us abound. Thanks for your support!

Gaurav is a software enthusiast from Bharat and Classic Vanquish tester & UX consultant. He started with Windows 95 and is good at software usability testing. He firmly believes that user feel is just as important as software code quality and architecture for software to be successful. View all posts by Gaurav Kale

Source: https://winaero.com/how-to-clear-the-windows-event-log-from-the-command-line/

Posted by: chavisiont1981.blogspot.com

0 Response to "How To Clear Event Viewer Windows 8.1"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel