Win7专业版系统怎么批量删除系统更新补丁
2018-04-17 15:47
微软都会不定时的给Windows操作系统推送补丁进行更新,而有时候win7系统用户发现更新之后可能觉得没有什么用就想要卸载,一般只需要到添加删除里面点击查看已安装更新然后就可以手动卸载了,不过如果要删除多个系统更新补丁的话一个个卸载太麻烦了,那么要怎么批量删除系统更新补丁呢,下面以win7专业版系统为例,为大家分享一下批量删除系统更新补丁的具体步骤。
1、在e盘,新建记事本,把以下代码复制其中,然后保存为文件名为a.ps1;
$KBID = “KB958488”
$KBID1 = “KB976902”
cls
function Remove-Update {
$HotFixes = Get-HotFix
[int]$count = 0;
foreach ($HotFix in $HotFixes)
{
$count = $count + 1
Write-Host $count / $HotFixes.Count
if (($KBID -ne $HotFix.HotfixId) -and ($KBID1 -ne $HotFix.HotfixId))
{
“Inside first if”
$KBID = $HotFix.HotfixId.Replace(“KB”, “”)
$RemovalCommand = “wusa.exe /uninstall /kb:$KBID /quiet /norestart”
Write-Host “Removing $KBID from the target.”
Invoke-Expression $RemovalCommand
}
if ($KBID -match “All”)
{
$KBNumber = $HotFix.HotfixId.Replace(“KB”, “”)
$RemovalCommand = “wusa.exe /uninstall /kb:$KBNumber /quiet /norestart”
Write-Host “Removing update $KBNumber from the target.”
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 “Removing Security Update $KBSecurity from the target.”
Invoke-Expression $RemovalCommand
}
}
while (@(Get-Process wusa -ErrorAction SilentlyContinue)。Count -ne 0)
{
Start-Sleep 3
Write-Host “Waiting for update removal to finish …”
}
}
}
Remove-Update
2、点开开始-找到搜索-输入cmd-右键选择管理员打开;
3、输入PowerShell ,然后回车;
4、输入Set-ExecutionPolicy RemoteSigned ,然后回车;
5、输入E:a.ps1,然后回车。
关于Win7专业版系统怎么批量删除系统更新补丁就给大家介绍到这边了,有需要的用户们可以采取上面的方法步骤来进行操作,更多精彩内容欢迎继续关注最新win7系统下载站!
1、在e盘,新建记事本,把以下代码复制其中,然后保存为文件名为a.ps1;
$KBID = “KB958488”
$KBID1 = “KB976902”
cls
function Remove-Update {
$HotFixes = Get-HotFix
[int]$count = 0;
foreach ($HotFix in $HotFixes)
{
$count = $count + 1
Write-Host $count / $HotFixes.Count
if (($KBID -ne $HotFix.HotfixId) -and ($KBID1 -ne $HotFix.HotfixId))
{
“Inside first if”
$KBID = $HotFix.HotfixId.Replace(“KB”, “”)
$RemovalCommand = “wusa.exe /uninstall /kb:$KBID /quiet /norestart”
Write-Host “Removing $KBID from the target.”
Invoke-Expression $RemovalCommand
}
if ($KBID -match “All”)
{
$KBNumber = $HotFix.HotfixId.Replace(“KB”, “”)
$RemovalCommand = “wusa.exe /uninstall /kb:$KBNumber /quiet /norestart”
Write-Host “Removing update $KBNumber from the target.”
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 “Removing Security Update $KBSecurity from the target.”
Invoke-Expression $RemovalCommand
}
}
while (@(Get-Process wusa -ErrorAction SilentlyContinue)。Count -ne 0)
{
Start-Sleep 3
Write-Host “Waiting for update removal to finish …”
}
}
}
Remove-Update
2、点开开始-找到搜索-输入cmd-右键选择管理员打开;
3、输入PowerShell ,然后回车;
4、输入Set-ExecutionPolicy RemoteSigned ,然后回车;
5、输入E:a.ps1,然后回车。
关于Win7专业版系统怎么批量删除系统更新补丁就给大家介绍到这边了,有需要的用户们可以采取上面的方法步骤来进行操作,更多精彩内容欢迎继续关注最新win7系统下载站!
网友评论