/ Published in: DOS Batch
This is a simple batch script to clear the event logs from a windows 7 or server 2008 machine. The script does not save these logs. This was tested on a local machine but could be adapted for remote use.
Expand |
Embed | Plain Text
@echo off @cls ::Tested on a local machine using Windows 7 x64 Home Premium ::Use the ping command to wait -n # seconds; change # for time to wait ::Basic code can be found in various places on the internet ::Modified by Rectifier 06-30-2012 ::If you receive an error try running the batch file as an administrator ::Note that the event log has to be enabled to begin with or this is a fairly useless batch ::Make readable prompt echo Clearing event logs... wevtutil.exe cl "Microsoft-Windows-Diagnosis-DPS/Operational" wevtutil.exe cl "Microsoft-Windows-User Profile Service/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/Firewall" wevtutil.exe cl System ::Informing the batch is finished executing echo Batch finished! ping 127.0.0.1 -n 3 | find "Reply" > nul
You need to login to post a comment.
