;===================================================================
;清除应用程序、安全性、系统日志
;===================================================================
_CleanEvent(1)
Func _CleanEvent($s=1)
$strComputer= "."
$objWMIService = ObjGet("winmgmts:" & "{impersonationLevel=impersonate,(Backup)}!\\" & $strComputer & "\root\cimv2")
Dim $mylogs[4]
$mylogs[1]="application"
$mylogs[2]="system"
$mylogs[3]="security"
For $logs in $mylogs
$colLogFiles = $objWMIService.ExecQuery ('Select * from Win32_NTEventLogFile where LogFileName="' & $logs & '"')
For $objLogfile in $colLogFiles
$objLogFile.ClearEventLog()
Next
Next
MsgBox(64,"清除日志","清除“应用程序”,“安全性”,“系统”成功!!!",2)
EndFunc
posted on 2008-01-18 11:52
疾风随影 阅读(528)
评论(0) 编辑 收藏 引用 所属分类:
AutoIT column