win7批量删除系统更新补丁
1、在e盘,新建记事本,把以下代码复制其中,然后保存为文件名为a.ps1。$KBID=争犸禀淫"KB958488"$KBID1="KB976902"稆糨孝汶;clsfunctionRemove-Update{$HotFixes=Get-HotFix[int]$count=0;foreach($HotFixin$HotFixes){$count=$count+1Write-Host$count/$HotFixes.Countif(($KBID-ne$HotFix.HotfixId)-and($KBID1-ne$HotFix.HotfixId)){"Insidefirstif"$KBID=$HotFix.HotfixId.Replace("KB","")$RemovalCommand="wusa.exe/uninstall/kb:$KBID/quiet/norestart"Write-Host"Removing$KBIDfromthetarget."Invoke-Expression$RemovalCommand}if($KBID-match"All"){$KBNumber=$HotFix.HotfixId.Replace("KB","")$RemovalCommand="wusa.exe/uninstall/kb:$KBNumber/quiet/norestart"Write-Host"Removingupdate$KBNumberfromthetarget."Invoke-Expression$RemovalCommand}if($KBID-match"Security"){if($HotFix.Description-match"Security"){$KBSecurity=$HotFix.HotfixId.Replace("KB","")$RemovalCommand="wusa.exe/uninstall/kb:$KBSecurity/quiet/norestart"Write-Host"RemovingSecurityUpdate$KBSecurityfromthetarget."Invoke-Expression$RemovalCommand}}while(@(Get-Processwusa-ErrorActionSilentlyContinue).Count-ne0){Start-Sleep3Write-Host"Waitingforupdateremovaltofinish..."}}}Remove-Update
2、点开开始-找到搜索-输入cmd-右键选择管理员打开。
3、输入PowerShell ,然后回车。
4、输入Set-ExecutionPolicyRemoteSigned ,然后回车。
5、输入E:a.ps1,然后回车。
6、以上代码的核心思想:windows 的"wusa.exe"和ps1批处理文件,全部步骤操作完,最后重启电脑即可,因为补丁的配置,所以关机和开机都要挺久的。请不要断电,直到电脑回到系统桌面。