I want to get list of installed windows hotfix and updates. I use script below:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colQuickFixes = objWMIService.ExecQuery _
("Select * from Win32_QuickFixEngineering")
Set objDateTime = CreateObject("WbemScripting.SWbemDateTime")
For Each objQuickFix in colQuickFixes
Wscript.Echo "Computer: " & objQuickFix.CSName
Wscript.Echo "Description: " & objQuickFix.Description
Wscript.Echo "Hot Fix ID: " & objQuickFix.HotFixID
If Not (IsNull(objQuickFix.InstallDate) Or _
IsEmpty(objQuickFix.InstallDate)) Then
objDateTime.Value = objQuickFix.InstallDate
Wscript.Echo "Installation Date: " & objDateTime.GetFileTime
Else
WScript.Echo "Install Date Type: " &
TypeName(objQuickFix.In开发者_如何学JAVAstallDate)
End If
Wscript.Echo "Installed By: " & objQuickFix.InstalledBy
Next
When I run this script I get Error message:
Syntax error
Error Code 800A03EA
What's wrong in this piece of code? Thanks! Sorry if my English is not perfect.
You are missing the line continuation character (_) here:
''#                        -----------
''#                                  |
''#                                  \/
WScript.Echo "Install Date Type: " & _
TypeName(objQuickFix.InstallDate)
Either add it or put the code in a singe line:
WScript.Echo "Install Date Type: " & TypeName(objQuickFix.InstallDate)
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论