【发布时间】:2013-05-31 08:04:33
【问题描述】:
我正在使用来自 Microsoft 的 this sample script 进行 Windows 更新。但是,每当安装更新时,我都想将其写入自定义日志。现在,我将代码的最后一部分调整如下:
For I = 0 to updatesToInstall.Count - 1
WScript.Echo I + 1 & "> " & _
updatesToInstall.Item(i).Title & _
": " & installationResult.GetUpdateResult(i).ResultCode
Set WshShell = WScript.CreateObject("WScript.Shell")
addLog = "eventcreate /l Application /t Information /so Test-QA /id 74 /d Windows update added: " & updatesToInstall.Item(i).Title
WshShell.Run addLog
Next
End If
但是,安装更新后,Windows 事件日志中没有添加任何内容。我应该怎么做才能将此信息写入日志?
【问题讨论】: