gpt4 book ai didi

使用 vbscript 检查 Windows 更新

转载 作者:可可西里 更新时间:2023-11-01 11:14:50 24 4
gpt4 key购买 nike

有人有脚本/或可以帮助我检查,是否有可用的服务器的 Windows 更新?

所以当黄色更新图标出现在任务栏中时,我会收到一封邮件。

我的想法是:发送邮件,如果任务栏中的wuauclt.exe超过10分钟。

但我不知道该怎么做。

我只找到了这个:

Dim strComputer, strProcess
Do
strProcess = inputbox( "Please enter the name of the process (for instance: explorer.exe)", "Input" )
Loop until strProcess <> ""
Do
strComputer = inputbox( "Please enter the computer name", "Input" )
Loop until strComputer <> ""
If( IsProcessRunning( strComputer, strProcess ) = True ) Then
WScript.Echo "Process " & strProcess & " is running on computer " & strComputer
Else
WScript.Echo "Process " & strProcess & " is NOT running on computer " & strComputer
End If

感谢您的帮助。

最佳答案

这样的事情怎么样

'Microsoft magic
Set updateSession = CreateObject("Microsoft.Update.Session")
Set updateSearcher = updateSession.CreateupdateSearcher()
Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'")
'End Microsoft magic

If searchResult.Updates.Count <> 0 Then 'If updates were found
'This is where you add your code to send an E-Mail.
'Send E-mail including a list of updates needed.

'This is how you can list the title of each update that was found.
'You could include the list in the body of your E-Mail.
For i = 0 To searchResult.Updates.Count - 1
Set update = searchResult.Updates.Item(i)
WScript.Echo update.Title
Next
End If

关于使用 vbscript 检查 Windows 更新,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3179914/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com