usera Posted April 11, 2014 Share Posted April 11, 2014 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 More sharing options...
jguinch Posted April 11, 2014 Share Posted April 11, 2014 Make a search for "Win32_QuickFixEngineering" in the forum. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
sahsanu Posted April 11, 2014 Share Posted April 11, 2014 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 usera 1 Link to comment Share on other sites More sharing options...
usera Posted April 12, 2014 Author Share Posted April 12, 2014 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now