How to clear out the Event Viewer Log Files

Discussion in 'Application Software' started by Palladin, Apr 5, 2014.

  1. Palladin

    Palladin MDL Senior Member

    Feb 1, 2014
    318
    129
    10
    #1 Palladin, Apr 5, 2014
    Last edited: Apr 5, 2014
    Clearing Event Viewer log files

    All versions of Windows have Event Logs. They are something that are kept up to date by the operating system, and it does it without you having to do anything. The logs hold information about what is going right and wrong with the operating system. They are very helpful when problems arise, and you need some information as to what is happening. You can find the Event Viewer in the Administrative Tools folder. Or you can Start / Run and then type eventvwr.msc, and press enter.

    You can customize the Event Logs to display various information based on what you want to see. But the biggest problem is that there are so many of them. In Windows 7 Professional there are over 450 of them, and they just keep growing and growing unless you manually clear them. No big deal to go through them once and a while and clear them one by one. But its a bit tedious for sure. You can see the event logs by going to c:\windows\system32\winevt\logs. Even though there are only 150+ files in this directory, there are over 450 logs.

    The good news is that there is a built in utility that will clear the logs automatically. It’s all command line driven, and you will need to run it from an elevated DOS prompt. The program is called wevtutil.exe and it comes with of all versions of Vista and Windows 7. Not sure about Version 8, though

    When you run wevtutil.exe /? you will see something like this:

    wevutil-help.jpg

    You want to list all of the log names by using the “el” switch. When you type wevtutil.exe el you will see something like this partial listing:

    wevutil-el-listing.jpg

    You could just clear them one by one but we want to automate this process. What you need to do is to get all of the log names in a file so you can edit the file, by adding in the correct command, and saving it as a batch file. The first step is to pipe the output of the wevtutil.exe el command to a file. The command looks like this: wevtutil.exe el > c:\event.txt. Be sure to leave spaces in the command line as shown.

    Now you will have a text file called event.txt that you can edit with any text editor. Here’s what it looks like in Notepad:

    win-pro-7-event.jpg


    We have to add wevtutil.exe cl to each line. Just type it in the first line, hi-light it, and then Ctrl-C to copy it, move to the next line and and Ctrl-V to paste wevtutil.exe cl to the beginning of each line. You need to add quotation marks any of the event log listings that have spaces in the name. I’ve grouped all of the ones that have spaces at the top of the file, and added quotes around them. You may have more or less event logs than this depending on your installation. No harm done if you leave out the quotes, you will just get an error message, and the log won’t be cleared. Here’s what the updated text file looks like:

    win-pro-7-batch-file.jpg

    When you have added the command wevtutil.exe cl to all lines, then save the text file as Clear_Event_Log.bat or whatever you want to call it. Just be sure that the extension is .bat, this is important! Then just run it, or double click it. After it runs you can see the results by going to where the event logs are stored: c:\windows\system32\winevt\logs and it should look like this:

    file-manager-cleared-log-files.jpg


    All the files will have been cleared. and should all have a file size of 69,632. So now when you check your event logs you will have current events in them, and not have to root through hundreds, perhaps thousands of old entries. Note that the DebugChannel.etl log file is smaller than the others. I don’t know why, and it might have something to do with the fact that you will get an error message on this entry when you run the batch file.

    A couple of things to watch out for. There are lots of entries with spaces in them, and they are easy to miss. You can pipe the output of the batch file to a log file and examine it to see where the errors are, and correct them. Or do as I did, and imported the initial text file into Excel where it’s much easier to identify the entries with spaces, sort them and add the necessary quotes.

    Or you could just download the batch file that I created and save yourself lots of work. :p

    : batch file to clear all the event log files in Windows 7 Professional, 32-Bit.
    : Be aware that this might not work as advertised in other versions of Windows 7, like Home Premium,
    : Ultimate, or any 64-Bit version.
    : Copy everything below and save it to Clear-Event-Logs.bat or whatever you want to name it.
    : Just be sure to give whatever file name you chose a .bat extension
    :=========================================================================
    wevtutil.exe cl "Key Management Service"
    wevtutil.exe cl "Media Center"
    wevtutil.exe cl "Windows PowerShell"
    wevtutil.exe cl "Internet Explorer"
    wevtutil.exe cl "Microsoft-Windows-User Control Panel Performance/Diagnostic"
    wevtutil.exe cl "Microsoft-Windows-User Profile Service/Diagnostic"
    wevtutil.exe cl "Microsoft-Windows-User Profile Service/Operational"
    wevtutil.exe cl "Microsoft-Windows-Known Folders API Service"
    wevtutil.exe cl "Microsoft-Windows-Folder Redirection/Operational"
    wevtutil.exe cl "Microsoft-Windows-Windows Defender/Operational"
    wevtutil.exe cl "Microsoft-Windows-Windows Defender/WHC"
    wevtutil.exe cl "Microsoft-Windows-Windows Firewall With Advanced Security/ConnectionSecurity"
    wevtutil.exe cl "Microsoft-Windows-Windows Firewall With Advanced Security/ConnectionSecurityVerbose"
    wevtutil.exe cl "Microsoft-Windows-Windows Firewall With Advanced Security/Firewall"
    wevtutil.exe cl "Microsoft-Windows-Windows Firewall With Advanced Security/FirewallVerbose"
    wevtutil.exe cl "Microsoft-Windows-HomeGroup Control Panel Performance/Diagnostic"
    wevtutil.exe cl "Microsoft-Windows-HomeGroup Control Panel/Operational"
    wevtutil.exe cl "Microsoft-Windows-HomeGroup Listener Service/Operational"
    wevtutil.exe cl "Microsoft-Windows-HomeGroup Provider Service Performance/Diagnostic"
    wevtutil.exe cl "Microsoft-Windows-HomeGroup Provider Service/Operational"
    wevtutil.exe cl "Microsoft-Windows-RemoteApp and Desktop Connections/Admin"
    wevtutil.exe cl "Microsoft-Windows-RemoteApp and Desktop Connections/Operational"
    wevtutil.exe cl "Microsoft-Windows-Application Server-Applications/Admin"
    wevtutil.exe cl "Microsoft-Windows-Application Server-Applications/Analytic"
    wevtutil.exe cl "Microsoft-Windows-Application Server-Applications/Debug"
    wevtutil.exe cl "Microsoft-Windows-Application Server-Applications/Operational"
    wevtutil.exe cl "Microsoft-Windows-AppLocker/EXE and DLL"
    wevtutil.exe cl "Microsoft-Windows-AppLocker/MSI and Script"
    wevtutil.exe cl "Microsoft-Windows-Authentication User Interface/Operational"
    wevtutil.exe cl Analytic
    wevtutil.exe cl Application
    wevtutil.exe cl DebugChannel
    wevtutil.exe cl DirectShowFilterGraph
    wevtutil.exe cl DirectShowPluginControl
    wevtutil.exe cl EndpointMapper
    wevtutil.exe cl ForwardedEvents
    wevtutil.exe cl HardwareEvents
    wevtutil.exe cl MF_MediaFoundationDeviceProxy
    wevtutil.exe cl MediaFoundationDeviceProxy
    wevtutil.exe cl MediaFoundationPerformance
    wevtutil.exe cl MediaFoundationPipeline
    wevtutil.exe cl MediaFoundationPlatform
    wevtutil.exe cl Microsoft-IE/Diagnostic
    wevtutil.exe cl Microsoft-IEFRAME/Diagnostic
    wevtutil.exe cl Microsoft-PerfTrack-IEFRAME/Diagnostic
    wevtutil.exe cl Microsoft-PerfTrack-MSHTML/Diagnostic
    wevtutil.exe cl Microsoft-Windows-ADSI/Debug
    wevtutil.exe cl Microsoft-Windows-API-Tracing/Operational
    wevtutil.exe cl Microsoft-Windows-ATAPort/General
    wevtutil.exe cl Microsoft-Windows-ATAPort/SATA-LPM
    wevtutil.exe cl Microsoft-Windows-ActionQueue/Analytic
    wevtutil.exe cl Microsoft-Windows-AltTab/Diagnostic
    wevtutil.exe cl Microsoft-Windows-AppID/Operational
    wevtutil.exe cl Microsoft-Windows-Application-Experience/Problem-Steps-Recorder
    wevtutil.exe cl Microsoft-Windows-Application-Experience/Program-Compatibility-Assistant
    wevtutil.exe cl Microsoft-Windows-Application-Experience/Program-Compatibility-Troubleshooter
    wevtutil.exe cl Microsoft-Windows-Application-Experience/Program-Inventory
    wevtutil.exe cl Microsoft-Windows-Application-Experience/Program-Inventory/Debug
    wevtutil.exe cl Microsoft-Windows-Application-Experience/Program-Telemetry
    wevtutil.exe cl Microsoft-Windows-Audio/CaptureMonitor
    wevtutil.exe cl Microsoft-Windows-Audio/Operational
    wevtutil.exe cl Microsoft-Windows-Audio/Performance
    wevtutil.exe cl Microsoft-Windows-Audit/Analytic
    wevtutil.exe cl Microsoft-Windows-AxInstallService/Log
    wevtutil.exe cl Microsoft-Windows-BTH-BTHUSB/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Backup
    wevtutil.exe cl Microsoft-Windows-Biometrics/Operational
    wevtutil.exe cl Microsoft-Windows-Bits-Client/Analytic
    wevtutil.exe cl Microsoft-Windows-Bits-Client/Operational
    wevtutil.exe cl Microsoft-Windows-Bluetooth-MTPEnum/Operational
    wevtutil.exe cl Microsoft-Windows-BranchCache/Operational
    wevtutil.exe cl Microsoft-Windows-BranchCacheClientEventProvider/Diagnostic
    wevtutil.exe cl Microsoft-Windows-BranchCacheEventProvider/Diagnostic
    wevtutil.exe cl Microsoft-Windows-BranchCacheSMB/Analytic
    wevtutil.exe cl Microsoft-Windows-BranchCacheSMB/Operational
    wevtutil.exe cl Microsoft-Windows-CAPI2/Operational
    wevtutil.exe cl Microsoft-Windows-CDROM/Operational
    wevtutil.exe cl Microsoft-Windows-COM/Analytic
    wevtutil.exe cl Microsoft-Windows-COMRuntime/Tracing
    wevtutil.exe cl Microsoft-Windows-Calculator/Debug
    wevtutil.exe cl Microsoft-Windows-Calculator/Diagnostic
    wevtutil.exe cl Microsoft-Windows-CertPoleEng/Operational
    wevtutil.exe cl Microsoft-Windows-CertificateServicesClient-CredentialRoaming/Operational
    wevtutil.exe cl Microsoft-Windows-ClearTypeTextTuner/Diagnostic
    wevtutil.exe cl Microsoft-Windows-CmiSetup/Analytic
    wevtutil.exe cl Microsoft-Windows-CodeIntegrity/Operational
    wevtutil.exe cl Microsoft-Windows-CodeIntegrity/Verbose
    wevtutil.exe cl Microsoft-Windows-ComDlg32/Analytic
    wevtutil.exe cl Microsoft-Windows-ComDlg32/Debug
    wevtutil.exe cl Microsoft-Windows-CorruptedFileRecovery-Client/Operational
    wevtutil.exe cl Microsoft-Windows-CorruptedFileRecovery-Server/Operational
    wevtutil.exe cl Microsoft-Windows-CredUI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Crypto-RNG/Analytic
    wevtutil.exe cl Microsoft-Windows-D3D10Level9/Analytic
    wevtutil.exe cl Microsoft-Windows-D3D10Level9/PerfTiming
    wevtutil.exe cl Microsoft-Windows-DCLocator/Debug
    wevtutil.exe cl Microsoft-Windows-DNS-Client/Operational
    wevtutil.exe cl Microsoft-Windows-DUI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-DUSER/Diagnostic
    wevtutil.exe cl Microsoft-Windows-DXGI/Analytic
    wevtutil.exe cl Microsoft-Windows-DXGI/Logging
    wevtutil.exe cl Microsoft-Windows-DXP/Analytic
    wevtutil.exe cl Microsoft-Windows-DateTimeControlPanel/Analytic
    wevtutil.exe cl Microsoft-Windows-DateTimeControlPanel/Debug
    wevtutil.exe cl Microsoft-Windows-DateTimeControlPanel/Operational
    wevtutil.exe cl Microsoft-Windows-Deplorch/Analytic
    wevtutil.exe cl Microsoft-Windows-DeviceSync/Analytic
    wevtutil.exe cl Microsoft-Windows-DeviceSync/Operational
    wevtutil.exe cl Microsoft-Windows-DeviceUx/Informational
    wevtutil.exe cl Microsoft-Windows-DeviceUx/Performance
    wevtutil.exe cl Microsoft-Windows-Dhcp-Client/Admin
    wevtutil.exe cl Microsoft-Windows-Dhcp-Client/Operational
    wevtutil.exe cl Microsoft-Windows-DhcpNap/Admin
    wevtutil.exe cl Microsoft-Windows-DhcpNap/Operational
    wevtutil.exe cl Microsoft-Windows-Dhcpv6-Client/Admin
    wevtutil.exe cl Microsoft-Windows-Dhcpv6-Client/Operational
    wevtutil.exe cl Microsoft-Windows-DiagCpl/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnosis-DPS/Analytic
    wevtutil.exe cl Microsoft-Windows-Diagnosis-DPS/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnosis-DPS/Operational
    wevtutil.exe cl Microsoft-Windows-Diagnosis-MSDE/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnosis-PCW/Analytic
    wevtutil.exe cl Microsoft-Windows-Diagnosis-PCW/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnosis-PCW/Operational
    wevtutil.exe cl Microsoft-Windows-Diagnosis-PLA/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnosis-PLA/Operational
    wevtutil.exe cl Microsoft-Windows-Diagnosis-Scheduled/Operational
    wevtutil.exe cl Microsoft-Windows-Diagnosis-Scripted/Admin
    wevtutil.exe cl Microsoft-Windows-Diagnosis-Scripted/Analytic
    wevtutil.exe cl Microsoft-Windows-Diagnosis-Scripted/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnosis-Scripted/Operational
    wevtutil.exe cl Microsoft-Windows-Diagnosis-ScriptedDiagnosticsProvider/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnosis-ScriptedDiagnosticsProvider/Operational
    wevtutil.exe cl Microsoft-Windows-Diagnosis-TaskManager/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnosis-WDC/Analytic
    wevtutil.exe cl Microsoft-Windows-Diagnosis-WDI/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnostics-Networking/Debug
    wevtutil.exe cl Microsoft-Windows-Diagnostics-Networking/Operational
    wevtutil.exe cl Microsoft-Windows-Diagnostics-PerfTrack-Counters/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Diagnostics-PerfTrack/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Diagnostics-Performance/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Diagnostics-Performance/Diagnostic/Loopback
    wevtutil.exe cl Microsoft-Windows-Diagnostics-Performance/Operational
    wevtutil.exe cl Microsoft-Windows-Direct3D10/Analytic
    wevtutil.exe cl Microsoft-Windows-Direct3D10_1/Analytic
    wevtutil.exe cl Microsoft-Windows-Direct3D11/Analytic
    wevtutil.exe cl Microsoft-Windows-Direct3D11/Logging
    wevtutil.exe cl Microsoft-Windows-Direct3D11/PerfTiming
    wevtutil.exe cl Microsoft-Windows-DirectShow-KernelSupport/Performance
    wevtutil.exe cl Microsoft-Windows-DirectSound/Debug
    wevtutil.exe cl Microsoft-Windows-DirectWrite-FontCache/Tracing
    wevtutil.exe cl Microsoft-Windows-DirectWrite/Tracing
    wevtutil.exe cl Microsoft-Windows-Disk/Operational
    wevtutil.exe cl Microsoft-Windows-DiskDiagnostic/Operational
    wevtutil.exe cl Microsoft-Windows-DiskDiagnosticDataCollector/Operational
    wevtutil.exe cl Microsoft-Windows-DiskDiagnosticResolver/Operational
    wevtutil.exe cl Microsoft-Windows-DisplayColorCalibration/Debug
    wevtutil.exe cl Microsoft-Windows-DisplayColorCalibration/Operational
    wevtutil.exe cl Microsoft-Windows-DisplaySwitch/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Documents/Performance
    wevtutil.exe cl Microsoft-Windows-DriverFrameworks-UserMode/Operational
    wevtutil.exe cl Microsoft-Windows-DxgKrnl/Diagnostic
    wevtutil.exe cl Microsoft-Windows-DxgKrnl/Performance
    wevtutil.exe cl Microsoft-Windows-DxpTaskRingtone/Analytic
    wevtutil.exe cl Microsoft-Windows-DxpTaskSyncProvider/Analytic
    wevtutil.exe cl Microsoft-Windows-EFS/Debug
    wevtutil.exe cl Microsoft-Windows-EapHost/Analytic
    wevtutil.exe cl Microsoft-Windows-EapHost/Debug
    wevtutil.exe cl Microsoft-Windows-EapHost/Operational
    wevtutil.exe cl Microsoft-Windows-EaseOfAccess/Diagnostic
    wevtutil.exe cl Microsoft-Windows-EventCollector/Debug
    wevtutil.exe cl Microsoft-Windows-EventCollector/Operational
    wevtutil.exe cl Microsoft-Windows-EventLog-WMIProvider/Debug
    wevtutil.exe cl Microsoft-Windows-EventLog/Analytic
    wevtutil.exe cl Microsoft-Windows-EventLog/Debug
    wevtutil.exe cl Microsoft-Windows-FMS/Analytic
    wevtutil.exe cl Microsoft-Windows-FMS/Debug
    wevtutil.exe cl Microsoft-Windows-FMS/Operational
    wevtutil.exe cl Microsoft-Windows-FailoverClustering-Client/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Fault-Tolerant-Heap/Operational
    wevtutil.exe cl Microsoft-Windows-Feedback-Service-TriggerProvider
    wevtutil.exe cl Microsoft-Windows-FileInfoMinifilter/Operational
    wevtutil.exe cl Microsoft-Windows-Firewall-CPL/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Forwarding/Debug
    wevtutil.exe cl Microsoft-Windows-Forwarding/Operational
    wevtutil.exe cl Microsoft-Windows-GettingStarted/Diagnostic
    wevtutil.exe cl Microsoft-Windows-GroupPolicy/Operational
    wevtutil.exe cl Microsoft-Windows-HAL/Debug
    wevtutil.exe cl Microsoft-Windows-HealthCenter/Debug
    wevtutil.exe cl Microsoft-Windows-HealthCenter/Performance
    wevtutil.exe cl Microsoft-Windows-HealthCenterCPL/Performance
    wevtutil.exe cl Microsoft-Windows-Help/Operational
    wevtutil.exe cl Microsoft-Windows-HomeGroup-ListenerService
    wevtutil.exe cl Microsoft-Windows-HotStart/Diagnostic
    wevtutil.exe cl Microsoft-Windows-HttpService/Trace
    wevtutil.exe cl Microsoft-Windows-IKE/Operational
    wevtutil.exe cl Microsoft-Windows-IKEDBG/Debug
    wevtutil.exe cl Microsoft-Windows-IPBusEnum/Tracing
    wevtutil.exe cl Microsoft-Windows-IPSEC-SRV/Diagnostic
    wevtutil.exe cl Microsoft-Windows-International-RegionalOptionsControlPanel/Operational
    wevtutil.exe cl Microsoft-Windows-International/Operational
    wevtutil.exe cl Microsoft-Windows-Iphlpsvc/Debug
    wevtutil.exe cl Microsoft-Windows-Iphlpsvc/Operational
    wevtutil.exe cl Microsoft-Windows-Iphlpsvc/Trace
    wevtutil.exe cl Microsoft-Windows-Kernel-Acpi/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Kernel-Boot/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-BootDiagnostics/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Kernel-Disk/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-EventTracing/Admin
    wevtutil.exe cl Microsoft-Windows-Kernel-EventTracing/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-File/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-Memory/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-Network/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-PnP/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Kernel-Power/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Kernel-Power/Thermal-Diagnostic
    wevtutil.exe cl Microsoft-Windows-Kernel-Power/Thermal-Operational
    wevtutil.exe cl Microsoft-Windows-Kernel-Prefetch/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Kernel-Process/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-Processor-Power/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Kernel-Registry/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-StoreMgr/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-StoreMgr/Operational
    wevtutil.exe cl Microsoft-Windows-Kernel-WDI/Analytic
    wevtutil.exe cl Microsoft-Windows-Kernel-WDI/Debug
    wevtutil.exe cl Microsoft-Windows-Kernel-WDI/Operational
    wevtutil.exe cl Microsoft-Windows-Kernel-WHEA/Errors
    wevtutil.exe cl Microsoft-Windows-Kernel-WHEA/Operational
    wevtutil.exe cl Microsoft-Windows-L2NA/Diagnostic
    wevtutil.exe cl Microsoft-Windows-LDAP-Client/Debug
    wevtutil.exe cl Microsoft-Windows-LUA-ConsentUI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-LanguagePackSetup/Analytic
    wevtutil.exe cl Microsoft-Windows-LanguagePackSetup/Debug
    wevtutil.exe cl Microsoft-Windows-LanguagePackSetup/Operational
    wevtutil.exe cl Microsoft-Windows-MCT/Operational
    wevtutil.exe cl Microsoft-Windows-MPS-CLNT/Diagnostic
    wevtutil.exe cl Microsoft-Windows-MPS-DRV/Diagnostic
    wevtutil.exe cl Microsoft-Windows-MPS-SRV/Diagnostic
    wevtutil.exe cl Microsoft-Windows-MSPaint/Admin
    wevtutil.exe cl Microsoft-Windows-MSPaint/Debug
    wevtutil.exe cl Microsoft-Windows-MSPaint/Diagnostic
    wevtutil.exe cl Microsoft-Windows-MUI/Admin
    wevtutil.exe cl Microsoft-Windows-MUI/Analytic
    wevtutil.exe cl Microsoft-Windows-MUI/Debug
    wevtutil.exe cl Microsoft-Windows-MUI/Operational
    wevtutil.exe cl Microsoft-Windows-MediaFoundation-MFReadWrite/SinkWriter
    wevtutil.exe cl Microsoft-Windows-MediaFoundation-MFReadWrite/SourceReader
    wevtutil.exe cl Microsoft-Windows-MediaFoundation-MFReadWrite/Transform
    wevtutil.exe cl Microsoft-Windows-MediaFoundation-PlayAPI/Analytic
    wevtutil.exe cl Microsoft-Windows-MemoryDiagnostics-Results/Debug
    wevtutil.exe cl Microsoft-Windows-MobilityCenter/Performance
    wevtutil.exe cl Microsoft-Windows-NCSI/Analytic
    wevtutil.exe cl Microsoft-Windows-NCSI/Operational
    wevtutil.exe cl Microsoft-Windows-NDF-HelperClassDiscovery/Debug
    wevtutil.exe cl Microsoft-Windows-NDIS-PacketCapture/Diagnostic
    wevtutil.exe cl Microsoft-Windows-NDIS/Diagnostic
    wevtutil.exe cl Microsoft-Windows-NDIS/Operational
    wevtutil.exe cl Microsoft-Windows-NTLM/Operational
    wevtutil.exe cl Microsoft-Windows-NWiFi/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Narrator/Diagnostic
    wevtutil.exe cl Microsoft-Windows-NetShell/Performance
    wevtutil.exe cl Microsoft-Windows-Network-and-Sharing-Center/Diagnostic
    wevtutil.exe cl Microsoft-Windows-NetworkAccessProtection/Operational
    wevtutil.exe cl Microsoft-Windows-NetworkAccessProtection/WHC
    wevtutil.exe cl Microsoft-Windows-NetworkLocationWizard/Operational
    wevtutil.exe cl Microsoft-Windows-NetworkProfile/Diagnostic
    wevtutil.exe cl Microsoft-Windows-NetworkProfile/Operational
    wevtutil.exe cl Microsoft-Windows-Networking-Correlation/Diagnostic
    wevtutil.exe cl Microsoft-Windows-NlaSvc/Diagnostic
    wevtutil.exe cl Microsoft-Windows-NlaSvc/Operational
    wevtutil.exe cl Microsoft-Windows-OLEACC/Debug
    wevtutil.exe cl Microsoft-Windows-OLEACC/Diagnostic
    wevtutil.exe cl Microsoft-Windows-OOBE-Machine/Diagnostic
    wevtutil.exe cl Microsoft-Windows-OfflineFiles/Analytic
    wevtutil.exe cl Microsoft-Windows-OfflineFiles/Debug
    wevtutil.exe cl Microsoft-Windows-OfflineFiles/Operational
    wevtutil.exe cl Microsoft-Windows-OfflineFiles/SyncLog
    wevtutil.exe cl Microsoft-Windows-OneX/Diagnostic
    wevtutil.exe cl Microsoft-Windows-OobeLdr/Analytic
    wevtutil.exe cl Microsoft-Windows-PCI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-ParentalControls/Operational
    wevtutil.exe cl Microsoft-Windows-PeerToPeerDrtEventProvider/Diagnostic
    wevtutil.exe cl Microsoft-Windows-PeopleNearMe/Operational
    wevtutil.exe cl Microsoft-Windows-PortableDeviceStatusProvider/Analytic
    wevtutil.exe cl Microsoft-Windows-PortableDeviceSyncProvider/Analytic
    wevtutil.exe cl Microsoft-Windows-PowerCfg/Diagnostic
    wevtutil.exe cl Microsoft-Windows-PowerCpl/Diagnostic
    wevtutil.exe cl Microsoft-Windows-PowerEfficiencyDiagnostics/Diagnostic
    wevtutil.exe cl Microsoft-Windows-PowerShell/Analytic
    wevtutil.exe cl Microsoft-Windows-PowerShell/Operational
    wevtutil.exe cl Microsoft-Windows-PrimaryNetworkIcon/Performance
    wevtutil.exe cl Microsoft-Windows-PrintService/Admin
    wevtutil.exe cl Microsoft-Windows-PrintService/Debug
    wevtutil.exe cl Microsoft-Windows-PrintService/Operational
    wevtutil.exe cl Microsoft-Windows-Program-Compatibility-Assistant/Debug
    wevtutil.exe cl Microsoft-Windows-QoS-Pacer/Diagnostic
    wevtutil.exe cl Microsoft-Windows-QoS-qWAVE/Debug
    wevtutil.exe cl Microsoft-Windows-RPC-Proxy/Debug
    wevtutil.exe cl Microsoft-Windows-RPC/Debug
    wevtutil.exe cl Microsoft-Windows-RPC/EEInfo
    wevtutil.exe cl Microsoft-Windows-ReadyBoost/Analytic
    wevtutil.exe cl Microsoft-Windows-ReadyBoost/Operational
    wevtutil.exe cl Microsoft-Windows-ReadyBoostDriver/Analytic
    wevtutil.exe cl Microsoft-Windows-ReadyBoostDriver/Operational
    wevtutil.exe cl Microsoft-Windows-Recovery/Operational
    wevtutil.exe cl Microsoft-Windows-ReliabilityAnalysisComponent/Operational
    wevtutil.exe cl Microsoft-Windows-RemoteAssistance/Admin
    wevtutil.exe cl Microsoft-Windows-RemoteAssistance/Operational
    wevtutil.exe cl Microsoft-Windows-RemoteAssistance/Tracing
    wevtutil.exe cl Microsoft-Windows-Remotefs-UTProvider/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Resource-Exhaustion-Detector/Operational
    wevtutil.exe cl Microsoft-Windows-Resource-Exhaustion-Resolver/Operational
    wevtutil.exe cl Microsoft-Windows-Resource-Leak-Diagnostic/Operational
    wevtutil.exe cl Microsoft-Windows-ResourcePublication/Tracing
    wevtutil.exe cl Microsoft-Windows-RestartManager/Operational
    wevtutil.exe cl Microsoft-Windows-Search-Core/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Search-ProtocolHandlers/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Security-Audit-Configuration-Client/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Security-Audit-Configuration-Client/Operational
    wevtutil.exe cl Microsoft-Windows-Security-IdentityListener/Operational
    wevtutil.exe cl Microsoft-Windows-Security-SPP/Perf
    wevtutil.exe cl Microsoft-Windows-Sens/Debug
    wevtutil.exe cl Microsoft-Windows-ServiceReportingApi/Debug
    wevtutil.exe cl Microsoft-Windows-Services-Svchost/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Services/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Setup/Analytic
    wevtutil.exe cl Microsoft-Windows-SetupCl/Analytic
    wevtutil.exe cl Microsoft-Windows-SetupQueue/Analytic
    wevtutil.exe cl Microsoft-Windows-SetupUGC/Analytic
    wevtutil.exe cl Microsoft-Windows-ShareMedia-ControlPanel/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-AuthUI-BootAnim/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-AuthUI-Common/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-AuthUI-CredUI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-AuthUI-Logon/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-AuthUI-PasswordProvider/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-AuthUI-Shutdown/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-Core/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-DefaultPrograms/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shell-Shwebsvc
    wevtutil.exe cl Microsoft-Windows-Shell-ZipFolder/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Shsvcs/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Sidebar/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Speech-UserExperience/Diagnostic
    wevtutil.exe cl Microsoft-Windows-StickyNotes/Admin
    wevtutil.exe cl Microsoft-Windows-StickyNotes/Debug
    wevtutil.exe cl Microsoft-Windows-StickyNotes/Diagnostic
    wevtutil.exe cl Microsoft-Windows-StorDiag/Operational
    wevtutil.exe cl Microsoft-Windows-StorPort/Operational
    wevtutil.exe cl Microsoft-Windows-Subsys-Csr/Operational
    wevtutil.exe cl Microsoft-Windows-Subsys-SMSS/Operational
    wevtutil.exe cl Microsoft-Windows-Superfetch/Main
    wevtutil.exe cl Microsoft-Windows-Superfetch/StoreLog
    wevtutil.exe cl Microsoft-Windows-Sysprep/Analytic
    wevtutil.exe cl Microsoft-Windows-SystemHealthAgent/Diagnostic
    wevtutil.exe cl Microsoft-Windows-TCPIP/Diagnostic
    wevtutil.exe cl Microsoft-Windows-TSF-msctf/Debug
    wevtutil.exe cl Microsoft-Windows-TSF-msctf/Diagnostic
    wevtutil.exe cl Microsoft-Windows-TSF-msutb/Debug
    wevtutil.exe cl Microsoft-Windows-TSF-msutb/Diagnostic
    wevtutil.exe cl Microsoft-Windows-TZUtil/Operational
    wevtutil.exe cl Microsoft-Windows-TaskScheduler/Debug
    wevtutil.exe cl Microsoft-Windows-TaskScheduler/Diagnostic
    wevtutil.exe cl Microsoft-Windows-TaskScheduler/Operational
    wevtutil.exe cl Microsoft-Windows-TaskbarCPL/Diagnostic
    wevtutil.exe cl Microsoft-Windows-TerminalServices-ClientUSBDevices/Admin
    wevtutil.exe cl Microsoft-Windows-TerminalServices-ClientUSBDevices/Analytic
    wevtutil.exe cl Microsoft-Windows-TerminalServices-ClientUSBDevices/Debug
    wevtutil.exe cl Microsoft-Windows-TerminalServices-ClientUSBDevices/Operational
    wevtutil.exe cl Microsoft-Windows-TerminalServices-LocalSessionManager/Admin
    wevtutil.exe cl Microsoft-Windows-TerminalServices-LocalSessionManager/Analytic
    wevtutil.exe cl Microsoft-Windows-TerminalServices-LocalSessionManager/Debug
    wevtutil.exe cl Microsoft-Windows-TerminalServices-LocalSessionManager/Operational
    wevtutil.exe cl Microsoft-Windows-TerminalServices-MediaRedirection/Analytic
    wevtutil.exe cl Microsoft-Windows-TerminalServices-PnPDevices/Admin
    wevtutil.exe cl Microsoft-Windows-TerminalServices-PnPDevices/Analytic
    wevtutil.exe cl Microsoft-Windows-TerminalServices-PnPDevices/Debug
    wevtutil.exe cl Microsoft-Windows-TerminalServices-PnPDevices/Operational
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RDPClient/Analytic
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RDPClient/Debug
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RDPClient/Operational
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RdpSoundDriver/Capture
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RdpSoundDriver/Playback
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RemoteConnectionManager/Admin
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RemoteConnectionManager/Analytic
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RemoteConnectionManager/Debug
    wevtutil.exe cl Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational
    wevtutil.exe cl Microsoft-Windows-ThemeCPL/Diagnostic
    wevtutil.exe cl Microsoft-Windows-ThemeUI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-TunnelDriver
    wevtutil.exe cl Microsoft-Windows-UAC-FileVirtualization/Operational
    wevtutil.exe cl Microsoft-Windows-UAC/Operational
    wevtutil.exe cl Microsoft-Windows-UIAnimation/Diagnostic
    wevtutil.exe cl Microsoft-Windows-UIAutomationCore/Debug
    wevtutil.exe cl Microsoft-Windows-UIAutomationCore/Diagnostic
    wevtutil.exe cl Microsoft-Windows-UIAutomationCore/Perf
    wevtutil.exe cl Microsoft-Windows-UIRibbon/Diagnostic
    wevtutil.exe cl Microsoft-Windows-USB-USBHUB/Diagnostic
    wevtutil.exe cl Microsoft-Windows-USB-USBPORT/Diagnostic
    wevtutil.exe cl Microsoft-Windows-User-Loader/Analytic
    wevtutil.exe cl Microsoft-Windows-UserModePowerService/Diagnostic
    wevtutil.exe cl Microsoft-Windows-UserPnp/DeviceMetadata/Debug
    wevtutil.exe cl Microsoft-Windows-UserPnp/DeviceNotifications
    wevtutil.exe cl Microsoft-Windows-UserPnp/Performance
    wevtutil.exe cl Microsoft-Windows-UserPnp/SchedulerOperations
    wevtutil.exe cl Microsoft-Windows-UxTheme/Diagnostic
    wevtutil.exe cl Microsoft-Windows-VAN/Diagnostic
    wevtutil.exe cl Microsoft-Windows-VDRVROOT/Operational
    wevtutil.exe cl Microsoft-Windows-VHDMP/Operational
    wevtutil.exe cl Microsoft-Windows-VWiFi/Diagnostic
    wevtutil.exe cl Microsoft-Windows-VolumeControl/Performance
    wevtutil.exe cl Microsoft-Windows-VolumeSnapshot-Driver/Operational
    wevtutil.exe cl Microsoft-Windows-WABSyncProvider/Analytic
    wevtutil.exe cl Microsoft-Windows-WCN-Config-Registrar/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WER-Diag/Operational
    wevtutil.exe cl Microsoft-Windows-WFP/Analytic
    wevtutil.exe cl Microsoft-Windows-WFP/Operational
    wevtutil.exe cl Microsoft-Windows-WLAN-AutoConfig/Operational
    wevtutil.exe cl Microsoft-Windows-WLAN-Autoconfig/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WLANConnectionFlow/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WMI-Activity/Trace
    wevtutil.exe cl Microsoft-Windows-WMPDMCCore/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WMPDMCUI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WMPNSS-PublicAPI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WMPNSS-Service/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WMPNSSUI/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WPD-ClassInstaller/Analytic
    wevtutil.exe cl Microsoft-Windows-WPD-ClassInstaller/Operational
    wevtutil.exe cl Microsoft-Windows-WPD-CompositeClassDriver/Analytic
    wevtutil.exe cl Microsoft-Windows-WPD-CompositeClassDriver/Operational
    wevtutil.exe cl Microsoft-Windows-WPD-MTPClassDriver/Operational
    wevtutil.exe cl Microsoft-Windows-WSC-SRV/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WUSA/Debug
    wevtutil.exe cl Microsoft-Windows-WWAN-MM-Events/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WWAN-NDISUIO-EVENTS/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WWAN-SVC-Events/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WWAN-UI-Events/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WebIO-NDF/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WebIO/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WebServices/Tracing
    wevtutil.exe cl Microsoft-Windows-Win32k/Concurrency
    wevtutil.exe cl Microsoft-Windows-Win32k/Power
    wevtutil.exe cl Microsoft-Windows-Win32k/Render
    wevtutil.exe cl Microsoft-Windows-Win32k/Tracing
    wevtutil.exe cl Microsoft-Windows-Win32k/UIPI
    wevtutil.exe cl Microsoft-Windows-WinHTTP-NDF/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WinHttp/Diagnostic
    wevtutil.exe cl Microsoft-Windows-WinINet/Analytic
    wevtutil.exe cl Microsoft-Windows-WinRM/Analytic
    wevtutil.exe cl Microsoft-Windows-WinRM/Debug
    wevtutil.exe cl Microsoft-Windows-WinRM/Operational
    wevtutil.exe cl Microsoft-Windows-Windeploy/Analytic
    wevtutil.exe cl Microsoft-Windows-WindowsBackup/ActionCenter
    wevtutil.exe cl Microsoft-Windows-WindowsColorSystem/Debug
    wevtutil.exe cl Microsoft-Windows-WindowsColorSystem/Operational
    wevtutil.exe cl Microsoft-Windows-WindowsSystemAssessmentTool/Operational
    wevtutil.exe cl Microsoft-Windows-WindowsSystemAssessmentTool/Tracing
    wevtutil.exe cl Microsoft-Windows-WindowsUpdateClient/Operational
    wevtutil.exe cl Microsoft-Windows-Wininit/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Winlogon/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Winlogon/Operational
    wevtutil.exe cl Microsoft-Windows-Winsock-AFD/Operational
    wevtutil.exe cl Microsoft-Windows-Winsock-WS2HELP/Operational
    wevtutil.exe cl Microsoft-Windows-Winsrv/Analytic
    wevtutil.exe cl Microsoft-Windows-Wired-AutoConfig/Diagnostic
    wevtutil.exe cl Microsoft-Windows-Wired-AutoConfig/Operational
    wevtutil.exe cl Microsoft-Windows-Wordpad/Admin
    wevtutil.exe cl Microsoft-Windows-Wordpad/Debug
    wevtutil.exe cl Microsoft-Windows-Wordpad/Diagnostic
    wevtutil.exe cl Microsoft-Windows-mobsync/Diagnostic
    wevtutil.exe cl Microsoft-Windows-ntshrui
    wevtutil.exe cl Microsoft-Windows-osk/Diagnostic
    wevtutil.exe cl Microsoft-Windows-stobject/Diagnostic
    wevtutil.exe cl OAlerts
    wevtutil.exe cl Security
    wevtutil.exe cl Setup
    wevtutil.exe cl System
    wevtutil.exe cl TabletPC_InputPanel_Channel
    wevtutil.exe cl WINDOWS_MP4SDECD_CHANNEL
    wevtutil.exe cl WINDOWS_MSMPEG2VDEC_CHANNEL
    wevtutil.exe cl WINDOWS_WMPHOTO_CHANNEL
    wevtutil.exe cl WMPSetup
    wevtutil.exe cl WMPSyncEngine
    wevtutil.exe cl microsoft-windows-RemoteDesktopServices-RemoteDesktopSessionManager/Admin
    wevtutil.exe cl muxencode
     
  2. Leslie_Coffelt

    Leslie_Coffelt MDL Member

    Feb 6, 2014
    135
    37
    10
    CCleaner can do this as well. It's listed in the "Advanced" category and is disabled by default.
     
  3. ianymaty

    ianymaty MDL Member

    Jan 31, 2010
    115
    75
    10
    It's nice to have clear event log when you need to investigate current problems but it's too much of work as you described.

    Here is a simple code to do all this. Copy it in a text file and change the extention to .bat. Run the .bat as Administartor.

     
  4. Palladin

    Palladin MDL Senior Member

    Feb 1, 2014
    318
    129
    10
    #4 Palladin, Apr 5, 2014
    Last edited: Apr 5, 2014
    (OP)
    Your solution is much more elegant than mine is, that's for sure.

    I was never very good with that "If for in ## do while" stuff, but it looks like you are. :worthy:

    No way could I ever have come up with what you did. Not in a million years.

    Thanks for adding it to the thread.
     
  5. ianymaty

    ianymaty MDL Member

    Jan 31, 2010
    115
    75
    10
    It's not my come up. I take no credit for this.

    I found this solution on the internet somewhere and saved it for my usage.

    Glad it helps you and sure others will find it useful too.
     
  6. Palladin

    Palladin MDL Senior Member

    Feb 1, 2014
    318
    129
    10
    What version are you running?

    The version I'm running (v4.01.4093) doesn't have any option in Advanced to clear the event logs.
     
  7. Palladin

    Palladin MDL Senior Member

    Feb 1, 2014
    318
    129
    10
    Well whoever wrote it knows his way around the "If for in ## do while" batch file logic.

    When I ran the batch file, it worked as advertised, but there was one event log that it didn't clear. It was: Microsoft-Windows-Application-Experience%4Program-Telemetry.evtx. I ran my batch file and it didn't clear it either. I thought it might have something to do with the "-" in the file name or the %4 in the file name that equates to the "/" in the batch file. I enclosed the entry in quotes but after the batch file ran, it was still there.

    I monitored the directory in File Manager while the batch file ran, and it was cleared, but then it re-appears right away with a file size of 1,052,762. I can only guess that it's an active process that has a default file size or some such thing. Who knows.

    The only other file that isn't cleared by either routines is DebugChannel.etl and you get an error message in both routines. Guess that one is locked as well.
     
  8. ianymaty

    ianymaty MDL Member

    Jan 31, 2010
    115
    75
    10
    I don't have any errors. Don't know what you're talking about. After running the script in my Event viewer there are only "Log clear" entries (1 for Security / Audit Succes and 3 for System / Information)

    Since the script runs as admin there is a chance that your system is bugged. Looking for "Microsoft-Windows-Application-Experience%4Program-Telemetry.evtx" in Google most of the links suggest some problems virus/malware related

    Try with Unlocker to see what is keeping the file blocked.
     
  9. NICK@NUMBER11

    NICK@NUMBER11 MDL Expert

    Mar 23, 2010
    1,354
    631
    60
    or this....

     
  10. Leslie_Coffelt

    Leslie_Coffelt MDL Member

    Feb 6, 2014
    135
    37
    10
    #11 Leslie_Coffelt, Apr 16, 2014
    Last edited: Apr 16, 2014
    I'm running a later version. Don't know when this option was added.

    Update: Great thing about FileHippo - they have earlier versions of CCleaner. I installed your version and that feature is not there, just as you noted. Grab the latest and you should be good to go.
     

    Attached Files:

  11. Palladin

    Palladin MDL Senior Member

    Feb 1, 2014
    318
    129
    10
    Looking at the screen shot, are running the Professional version. I'm just running the free one. I wonder if there is a difference between the 32-Bit versions and the 64-Bit versions. That might explain the extra functionality missing in mine. I'll take a look at the web site and see if they have a matrix to confirm it. I'm betting they do.

    Good news. I just downloaded the latest and greatest free one, v4.12.4657 and the option to clear the Event Logs is there. :clap3: I'm going to give it a try, and see how it cleans up the log files.

    Thanks for the info.
     
  12. Palladin

    Palladin MDL Senior Member

    Feb 1, 2014
    318
    129
    10
    #13 Palladin, Apr 16, 2014
    Last edited: Apr 8, 2015
    (OP)
    I ran the latest and greatest version of Ccleaner, and here's what the log files looked like.

    ccleaner.jpg

    It cleared a few of them, but left many untouched. I wonder if the Professional version clears out more than the free version does. When I checked the option, it said that it would only clear only 6 or 7 files, which I thought was a bit odd. Maybe the free version doesn't clear as many as the Professional version.

    But when I ran the For-If-In-Do-While batch file, it cleared every one of the log files.

    for-if-in-do-while.jpg