Add mod: postSetup - uninstall pc health check

This commit is contained in:
Fierelier 2021-12-26 19:48:38 +01:00
parent ee27e2951c
commit 292fa8a9eb
3 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,4 @@
@echo off
setlocal
cd /d "%~dp0"
cscript //NoLogo uninstall-pchc.vbs

View File

@ -0,0 +1,16 @@
Set updateSearcher = updateSession.CreateUpdateSearcher()
Set searchResult = updateSearcher.Search("Type='Software'")
For I = 0 to searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
If InStr(1,update.Title,"KB5005463",1) > 0 then
If update.IsInstalled <> 0 Then
Set collection = CreateObject("Microsoft.Update.UpdateColl")
collection.add(update)
Set installer = CreateObject("Microsoft.Update.Installer")
installer.updates = collection
installer.Uninstall
End If
update.IsHidden = true
End If
Next

View File

@ -0,0 +1,2 @@
opusnt.runReg(["add",opusnt.regTmpPath + "software\\Microsoft\\PCHC","/v","PreviousUninstall","/t","REG_DWORD","/d","0x00000001","/f"])
opusnt.runReg(["add",opusnt.regTmpPath + "software\\Microsoft\\PCHealthCheck","/v","installed","/t","REG_DWORD","/d","0x00000001","/f"])