Jump to content
Sign in to follow this  
usera

hotfix checker

Recommended Posts

usera

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

Share this post


Link to post
Share on other sites
sahsanu

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

  • Like 1

Share this post


Link to post
Share on other sites
usera

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.