日志清理批处理
Posted err0">tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了日志清理批处理相关的知识,希望对你有一定的参考价值。
@echo off echo on error resume next>clear.vbs echo set wmi_clear=getobject("winmgmts:\\.\root\cimv2")>>clear.vbs echo dim lianan_names(2)>>clear.vbs echo lianan_names(0)="application">>clear.vbs echo lianan_names(1)="security">>clear.vbs echo lianan_names(2)="system">>clear.vbs echo for each lianan_name in lianan_names>>clear.vbs echo set lianan_logs=wmi_clear.execquery("select * from win32_nteventlogfile where logfilename=‘"^&lianan_name^&"‘")>>clear.vbs echo for each lianan_log in lianan_logs>>clear.vbs echo lianan_log.cleareventlog()>>clear.vbs echo next>>clear.vbs echo next>>clear.vbs echo 创建文件完毕! echo 正在清除日志... clear.vbs echo 清除日志完毕! echo 删除创建的文件 del /f /q clear.vbs echo 日志清除完毕 pause
以上是关于日志清理批处理的主要内容,如果未能解决你的问题,请参考以下文章