C:\Users\User>wmic nteventlog call /?
Method execution operations.
USAGE:
CALL <method name> [<actual paramlist>]
NOTE: <actual paramlist> ::= <actual param> | <actual param>, <actual paramlist
>
The following alias verb(s)/method(s) are available:
Call [ In/Out ]Params&type Status
==== ===================== ======
BackupEventlog [IN ]ArchiveFileName(STRING) (null)
ClearEventlog [IN ]ArchiveFileName(STRING) (null)
因此,像
wmic /node:127.0.0.1 nteventlog where filename='system' call ClearEventLog
是命令行版本。
在VBS中(&「。」是計算機名稱,表示本地計算機,使用名稱或IP地址)。
Set WMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & ".")
Set logFile = WMI.ExecQuery("Select * from Win32_NTEventLogFile " & "Where LogFileName='System'")
For Each F in LogFile
msgbox F.ClearEventLog
Next
你可能想從這裏開始你的研究:http://technet.microsoft.com/en-us/library/hh849789.aspx – 2014-09-20 14:42:17
這似乎更像是一個系統管理不是一個編程問題給我,所以它應該在[ServerFault](http://serverfault.com/)上被詢問。 – 2014-09-21 09:37:36