Search the Community
Showing results for tags 'hide windows updates'.
-
hopefully i got that right in the title so it loops through each of the updates in my case 4.. i dont want skype but have tried to add an option to stop more than just skype the loop is not right and unsure how to get right This is just some of the testing code as does not actual need download the updates while testing "Definition Update" --> Only using as a test for array. to make sure it works and it does not lol Local $Hideup[2] $Hideup[0] = "Skype for Windows" $Hideup[1] = "Definition Update" $updateSession = ObjCreate("Microsoft.update.Session") $updateSearcher = $updateSession.CreateupdateSearcher() ConsoleWrite("Searching for updates..." & @CRLF) $searchResult = $updateSearcher.Search("IsInstalled=0 and Type='Software' and IsAssigned=0") ; A LIST OF UPDATES For $I = 0 To $searchResult.Updates.Count - 1 $update = $searchResult.Updates.Item($I) ConsoleWrite($I + 1 & "> " & $update.Title & @CR) ;~ if StringInStr( $update.Title, $Hideup[0]) Then ConsoleWrite(@CRLF & 'YIPEE' & @CRLF) ; only check for 1 item Next If $searchResult.Updates.Count = 0 Then ConsoleWrite("There are no applicable updates.") Exit EndIf ConsoleWrite(@CRLF & "Creating collection of updates to download:" & @CR) $updatesToDownload = ObjCreate("Microsoft.update.UpdateColl") For $I = 0 To $searchResult.Updates.Count - 1 $update = $searchResult.Updates.Item($I) ;~ **************************************** ;~ **************************************** ;~ **************************************** For $j = 0 To UBound($Hideup) -1 If StringInStr($update.Title, $Hideup[$j]) Then ConsoleWrite('!' & $I + 1 & "> Removing: " & $update.Title & @CR) ExitLoop Else ConsoleWrite($I + 1 & "> adding: " & $update.Title & @CR) $updatesToDownload.Add($update) EndIf Next ;~ **************************************** ;~ **************************************** ;~ **************************************** Next so 1 worked and then is start getting doubles ups the results i get from console Searching for updates... 1> Skype for Windows desktop 7.3 (KB2876229) 2> Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.249.211.0) 3> August, 2017 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4035036) 4> Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.251.546.0) Creating collection of updates to download: !1> Removing: Skype for Windows desktop 7.3 (KB2876229) 2> adding: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.249.211.0) !2> Removing: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.249.211.0) 3> adding: August, 2017 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4035036) 3> adding: August, 2017 Preview of Quality Rollup for .NET Framework 3.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 on Windows 7 and Server 2008 R2 for x64 (KB4035036) 4> adding: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.251.546.0) !4> Removing: Definition Update for Microsoft Security Essentials - KB2310138 (Definition 1.251.546.0)