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