Jump to content

hotfix checker


 Share

Recommended Posts

Greeting,

I am looking for a way to check the windows hotfix installed or not.

I have a text file, let us called it "hotfixlist.txt", format like

kb12345678

kb12345679

kb12234576

..

...

...

 

I want to write a "au3" to check if the machine already installed or not.

for example:

if not kb12345678 is not installed, just show "kb12345678 is missing", 

if not kb12345679 is installed, then just go check next one

thanks

usera

Link to comment
Share on other sites

Just an example:

Global $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2")
Global $colItems = $objWMIService.ExecQuery("SELECT HotFixID from Win32_QuickFixEngineering", "WQL", 0x30)
Global $HotFixInstalled
If IsObj($colItems) Then
    For $objItem In $colItems
        $HotFixInstalled &= $objItem.HotFixID & ";"
    Next
EndIf

$aHotFixList = FileReadToArray("hotfixlist.txt")
For $i = 0 To UBound($aHotFixList) - 1
    If StringInStr($HotFixInstalled, $aHotFixList[$i]) = 0 Then
        ConsoleWrite("Hotfix " & $aHotFixList[$i] & " is missing" & @CRLF)
    EndIf
Next

Cheers,

sahsanu

Link to comment
Share on other sites

thanks, very useful

Just an example:

Global $objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2")
Global $colItems = $objWMIService.ExecQuery("SELECT HotFixID from Win32_QuickFixEngineering", "WQL", 0x30)
Global $HotFixInstalled
If IsObj($colItems) Then
    For $objItem In $colItems
        $HotFixInstalled &= $objItem.HotFixID & ";"
    Next
EndIf

$aHotFixList = FileReadToArray("hotfixlist.txt")
For $i = 0 To UBound($aHotFixList) - 1
    If StringInStr($HotFixInstalled, $aHotFixList[$i]) = 0 Then
        ConsoleWrite("Hotfix " & $aHotFixList[$i] & " is missing" & @CRLF)
    EndIf
Next

Cheers,

sahsanu

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...