Seb*_*ian 1 windows vbscript process
有人一个脚本/或可以帮助我检查,是否有可用的服务器的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
Run Code Online (Sandbox Code Playgroud)
感谢帮助.
这样的事情怎么样?
'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
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4622 次 |
| 最近记录: |