From bd06097b1c011cfb168a3fea07d5e4d37cd59afc Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Fri, 19 Feb 2016 21:05:21 +0300 Subject: [PATCH 1/2] Removed previous script, patched the .bat to use CleanUnwantedUpdates --- BlockWindows.bat | 76 ++---------------------------------------- HideWindowsUpdates.vbs | 39 ---------------------- 2 files changed, 3 insertions(+), 112 deletions(-) delete mode 100644 HideWindowsUpdates.vbs diff --git a/BlockWindows.bat b/BlockWindows.bat index d13c326..0403183 100644 --- a/BlockWindows.bat +++ b/BlockWindows.bat @@ -8,80 +8,10 @@ if not %errorlevel% equ 0 ( SETLOCAL -REM --- uninstall updates -echo uninstalling updates, be patient... -echo Delete KB971033 (license validation) -start "title" /b /wait wusa.exe /kb:971033 /uninstall /quiet /norestart -echo - next -echo Delete KB2902907 (Microsoft Security Essentials) -start "title" /b /wait wusa.exe /kb:2902907 /uninstall /quiet /norestart -echo - next -echo Delete KB2952664 (Get Windows 10 assistant) -start "title" /b /wait wusa.exe /kb:2952664 /uninstall /quiet /norestart -echo - next -echo Delete KB2976978 (update for windows 8.1 and windows 8) -start "title" /b /wait wusa.exe /kb:2976978 /uninstall /quiet /norestart -echo - next -echo Delete KB2977759 (update for windows 7 rtm) -start "title" /b /wait wusa.exe /kb:2977759 /uninstall /quiet /norestart -echo - next -echo Delete KB2990214 (Get Windows 10 for Win7) -start "title" /b /wait wusa.exe /kb:2990214 /uninstall /quiet /norestart -echo - next -echo Delete KB3012973 (Upgrade to Windows 10 Pro) -start "title" /b /wait wusa.exe /kb:3012973 /uninstall /quiet /norestart -echo - next -echo Delete KB3014460 (Upgrade for windows insider preview / upgrade to windows 10) -start "title" /b /wait wusa.exe /kb:3014460 /uninstall /quiet /norestart -echo - next -echo Delete KB3015249 (Upgrade that adds telemetry points to consent.exe in Windows 8.1 and Windows 7) -start "title" /b /wait wusa.exe /kb:3015249 /uninstall /quiet /norestart -echo - next -echo Delete KB3021917 (update to Windows 7 SP1 for performance improvements) -start "title" /b /wait wusa.exe /kb:3021917 /uninstall /quiet /norestart -echo - next -echo Delete KB3022345 (telemetry) -start "title" /b /wait wusa.exe /kb:3022345 /uninstall /quiet /norestart -echo - next -echo Delete KB3035583 (GWX Update installs Get Windows 10 app in Windows 8.1 and Windows 7 SP1) -start "title" /b /wait wusa.exe /kb:3035583 /uninstall /quiet /norestart -echo - next -echo Delete KB3044374 (Get Windows 10 for Win8.1) -start "title" /b /wait wusa.exe /kb:3044374 /uninstall /quiet /norestart -echo - next -echo Delete KB3050265 (update for Windows Update on Win7) -start "title" /b /wait wusa.exe /kb:3050265 /uninstall /quiet /norestart -echo - next -echo Delete KB3050267 (update for windows update client for windows 8.1 june 2015) -start "title" /b /wait wusa.exe /kb:3050267 /uninstall /quiet /norestart -echo - next -echo Delete KB3065987 (update for Windows Update on Win7/Server 2008R2) -start "title" /b /wait wusa.exe /kb:3065987 /uninstall /quiet /norestart -echo - next -echo Delete KB3068708 (telemetry) -start "title" /b /wait wusa.exe /kb:3068708 /uninstall /quiet /norestart -echo - next -echo Delete KB3075249 (telemetry for Win7/8.1) -start "title" /b /wait wusa.exe /kb:3075249 /uninstall /quiet /norestart -echo - next -echo Delete KB3075851 (update for Windows Update on Win7/Server 2008R2) -start "title" /b /wait wusa.exe /kb:3075851 /uninstall /quiet /norestart -echo - next -echo Delete KB3075853 (update for Windows Update on Win8.1/Server 2012R2) -start "title" /b /wait wusa.exe /kb:3075853 /uninstall /quiet /norestart -echo - next -echo Delete KB3080149 (Telemetry) -start "title" /b /wait wusa.exe /kb:3080149 /uninstall /quiet /norestart -echo - next -echo Delete KB3112336 (monitor quality of upgrade experience) -start "title" /b /wait wusa.exe /kb:3112336 /uninstall /quiet /norestart -echo - done. -timeout 5 -REM --- Hide updates -echo Hiding updates, may take a while be patient... - -start "title" /b /wait cscript.exe "%~dp0HideWindowsUpdates.vbs" 971033 2902907 2952664 2976978 2977759 2990214 3012973 3014460 3015249 3021917 3022345 3035583 3044374 3050265 3050267 3065987 3068708 3075249 3075851 3075853 3080149 3112336 +REM --- uninstall updates +echo uninstalling and hiding the updates, please, be patient... +start "title" /b /wait cscript.exe "%~dp0/CleanUnwantedUpdates/CleanUnwantedUpdates.wsf" echo - done. REM --- Disable tasks diff --git a/HideWindowsUpdates.vbs b/HideWindowsUpdates.vbs deleted file mode 100644 index 5b859e8..0000000 --- a/HideWindowsUpdates.vbs +++ /dev/null @@ -1,39 +0,0 @@ -'// Inspired by Opmet and Colin Bowern: http://serverfault.com/a/341318 -If Wscript.Arguments.Count < 1 Then - WScript.Echo "Syntax: HideWindowsUpdates.vbs [Hotfix Article ID]" & vbCRLF & _ - " - Examples: HideWindowsUpdates.vbs 2990214" & vbCRLF & _ - " - Examples: HideWindowsUpdates.vbs 3022345 3035583" - WScript.Quit 1 -End If - -Dim objArgs -Set objArgs = Wscript.Arguments -Dim updateSession, updateSearcher -Set updateSession = CreateObject("Microsoft.Update.Session") -Set updateSearcher = updateSession.CreateUpdateSearcher() - -Wscript.Stdout.Write "Searching for pending updates..." -Dim searchResult -Set searchResult = updateSearcher.Search("IsInstalled=0") - -Dim update, kbArticleId, index, index2 -WScript.Echo CStr(searchResult.Updates.Count) & " found." -For index = 0 To searchResult.Updates.Count - 1 - Set update = searchResult.Updates.Item(index) - For index2 = 0 To update.KBArticleIDs.Count - 1 - kbArticleId = update.KBArticleIDs(index2) - - For Each hotfixId in objArgs - If kbArticleId = hotfixId Then - If update.IsHidden = False Then - WScript.Echo "Hiding update: " & update.Title - update.IsHidden = True - Else - WScript.Echo "Already hidden: " & update.Title - End If - End If - Next - - Next -Next -'// EOF From e52a8f4142889fd8877a63a9148b4a04414a1ab3 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Fri, 19 Feb 2016 21:14:00 +0300 Subject: [PATCH 2/2] Added submodule --- .gitmodules | 4 ++++ CleanUnwantedUpdates | 1 + 2 files changed, 5 insertions(+) create mode 100644 .gitmodules create mode 160000 CleanUnwantedUpdates diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e4c0d0e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "CleanUnwantedUpdates"] + path = CleanUnwantedUpdates + url = https://github.com/KOLANICH/CleanUnwantedUpdates.git + update = merge \ No newline at end of file diff --git a/CleanUnwantedUpdates b/CleanUnwantedUpdates new file mode 160000 index 0000000..0ec825f --- /dev/null +++ b/CleanUnwantedUpdates @@ -0,0 +1 @@ +Subproject commit 0ec825fd3fbbb934cccf8814b3c50348be9fd049