Windows Hotfix 管理是通过 Microsoft Windows 更新管理工具和命令行工具进行的。在 Windows 操作系统中,Hotfix 是一种用于修复操作系统缺陷、漏洞或提供安全更新的软件包。以下是与 Windows Hotfix 管理相关的常用命令分类及其功能说明。


 


Windows 更新独立安装程序
Windows 更新独立安装程序

wusa </? | /h | /help>
wusa <update> [/quiet] [/norestart | /warnrestart:<seconds> /promptrestart |/forcerestart] [/log:<file name>]
wusa /uninstall <update> [/quiet] [/norestart | /warnrestart:<seconds> | /promptrestart | /forcerestart] [/log:<file name>]
wusa /uninstall /kb:<KB number> [/norestart | /warnrestart:<seconds> | /promptrestart | /forcerestart] [/log:<file name>]
I?. /h, /help-显示帮助信息。
wusa  update    - MSU 文件的完整路径。
wusa /quiet   - 安静模式,无用户交互。根据需要重启。
wusa /uninstall   -安装程序将卸载程序包。
wusa /kb   - 与 /uninstall 结合使用时,安装程序将卸载与 KB 数关联的程序包。

wusa /norestart  -与 /quiet 结合使用时,安装程序将不启动重启。
wusa /warnrestart   -与 /quiet 结合使用时,安装程序将在启动重启前向用户发出警告。
wusa /promptrestart   -与/quiet 结合使用时,安装程序将在启动重启前予以提示。
wusa /forcerestart  -与 /quiet 结合使用时,安装程序将强制性关闭应用程序并启动重启。
wusa /log    - 安装程序将启用日志记录


Windows ® Installer. V 5.0.26100.1150
 
msiexec /Option <Required Parameter> [Optional Parameter]
 
安装选项
</package | /i> <Product.msi>
安装或配置产品
/a <Product.msi>  管理安装 - 在网络上安装产品
/j<u|m> <Product.msi> [/t <Transform List>] [/g <Language ID>]   公布产品 - m 公布到所有用户,u 公布到当前用户
</uninstall | /x> <Product.msi | ProductCode>  卸载产品显示选项
/quiet  安静模式,无用户交互
/passive   无人参与模式 - 只显示进度栏
/q[n|b|r|f]  设置用户界面级别
n - 无用户界面
b - 基本界面
r - 精简界面
f - 完整界面(默认值)
/help帮助信息
重新启动选项
/norestart  安装完成后不重新启动
/promptrestart  必要时提示用户重新启动
/forcerestart  安装后始终重新启动计算机
日志选项
/l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <LogFile>
i - 状态消息
w - 非致命警告
e - 所有错误消息
a - 操作的启动
r - 操作特定记录
u - 用户请求
c - 初始用户界面参数
m - 内存不足或致命退出信息
o - 磁盘空间不足消息
p - 终端属性
v - 详细输出
x - 额外调试信息
+ - 扩展到现有日志文件
! - 每一行刷新到日志
* - 记录所有信息,除了 v 和 x 选项
/log <LogFile>与 /l* <LogFile> 相同
更新选项
/update <Update1.msp>[;Update2.msp]  应用更新
/uninstall <PatchCodeGuid>[;Update2.msp] /package <Product.msi | ProductCode>   删除产品的更新
修复选项
/f[p|e|c|m|s|o|d|a|u|v] <Product.msi | ProductCode>   修复产品
p - 仅当文件丢失时
o - 如果文件丢失或安装了更旧的版本(默认值)
e - 如果文件丢失或安装了相同或更旧的版本
d - 如果文件丢失或安装了不同版本
c - 如果文件丢失或较验和与计算的值不匹配
a - 强制重新安装所有文件
u - 所有必要的用户特定注册表项(默认值)
m - 所有必要的计算机特定注册表项(默认值)
s - 所有现有的快捷键方式(默认值)
v - 从源运行并重新缓存本地安装包
设置公共属性
[PROPERTY=PropertyValue]
 
请查阅 Windows (R) Installer SDK 获得有关命令行语法的其他文档。
 
版权所有 (C) Microsoft Corporation. 保留所有权利。
此软件的部分内容系基于 Independent JPEG Group 的工作。

Windows Hotfix 管理是通过 Microsoft Windows 更新管理工具和命令行工具进行的。在 Windows 操作系统中,Hotfix 是一种用于修复操作系统缺陷、漏洞或提供安全更新的软件包。以下是与 Windows Hotfix 管理相关的常用命令分类及其功能说明。

Windows Hotfix 管理命令分类表

命令/工具 命令描述 使用示例
系统信息命令    
systeminfo 显示 Windows 系统的详细信息,包括安装的 hotfix(补丁)。 systeminfo
    输出将包括已安装的所有 hotfix 的详细信息,例如 KB 号、安装日期等。
Windows 更新命令    
wuauclt /detectnow 强制 Windows 更新检测当前可用的更新。 wuauclt /detectnow
wuauclt /reportnow 提交计算机的更新状态信息给 Windows 更新服务器。 wuauclt /reportnow
wuauclt /updatenow 强制 Windows 更新安装最新的更新。 wuauclt /updatenow
powershell -Command "Get-WindowsUpdateLog" 查看 Windows 更新日志。此命令生成并显示更新的详细日志文件,帮助诊断更新问题。 powershell -Command "Get-WindowsUpdateLog"
查看已安装的补丁    
wmic qfe list 列出所有已安装的更新(hotfix),包括更新的 KB 编号、安装日期等信息。 wmic qfe list
wmic qfe list full 获取已安装更新的详细列表,包括每个 hotfix 的详细信息。 wmic qfe list full
wmic qfe where "HotFixID='KBxxxxxxx'" get InstalledOn 检查特定的 hotfix 是否已安装并显示安装日期。 wmic qfe where "HotFixID='KB1234567'" get InstalledOn
Get-HotFix (PowerShell) 在 PowerShell 中查看已安装的所有 hotfix 的信息。 Get-HotFix
卸载与删除更新    
wusa /uninstall 卸载已安装的 Windows 更新。可以通过指定更新的 KB 编号来卸载。 wusa /uninstall /kb:1234567
wusa /quiet 静默卸载更新,不显示用户界面。 wusa /uninstall /kb:1234567 /quiet
手动安装更新    
wusa 手动安装更新,通常用于安装 .msu 格式的 Windows 更新文件。 wusa C:\path\to\update.msu
msiexec /p 使用 MSI 命令行工具安装补丁(适用于 .msp 文件)。 msiexec /p C:\path\to\update.msp
Windows 更新服务    
net stop wuauserv 停止 Windows 更新服务(wuauserv)。 net stop wuauserv
net start wuauserv 启动 Windows 更新服务(wuauserv)。 net start wuauserv
清除更新缓存    
del %windir%\SoftwareDistribution\Download\* 清除 Windows 更新下载缓存文件夹。 del %windir%\SoftwareDistribution\Download\*
net stop wuauserv && rmdir /s /q %windir%\SoftwareDistribution 停止更新服务并删除软件分发文件夹,这可以清理 Windows 更新缓存。 net stop wuauserv && rmdir /s /q %windir%\SoftwareDistribution
查看更新安装历史    
Get-History (PowerShell) 获取 Windows 更新安装历史记录,查看已安装的更新详情。 Get-History
Get-WindowsUpdate (PowerShell) 使用 PowerShell 获取和管理 Windows 更新,包括列出已安装的更新。 Get-WindowsUpdate -ListInstalled
Windows 更新修复工具    
msdt.exe /id WindowsUpdateDiagnostic 启动 Windows 更新疑难解答工具,用于自动诊断和修复 Windows 更新相关问题。 msdt.exe /id WindowsUpdateDiagnostic
查看与安装更新的其他命令    
Get-WindowsUpdate (PowerShell) 查询并安装所有 Windows 更新。 Get-WindowsUpdate
Install-WindowsUpdate (PowerShell) 使用 PowerShell 自动安装可用的更新。 Install-WindowsUpdate -AcceptAll
日志与诊断    
Get-WindowsUpdateLog (PowerShell) 查看 Windows 更新日志,通常用于诊断更新问题。 Get-WindowsUpdateLog
Get-WindowsUpdateError (PowerShell) 获取 Windows 更新错误信息。 Get-WindowsUpdateError

说明

  • systeminfo 命令可以用于查看系统的基本信息,包括已安装的 Hotfix。对于需要检查系统补丁安装情况的用户,systeminfo 是一个非常基础且实用的命令。
  • wmic qfe list 和 Get-HotFix 等命令提供了查看系统中安装的所有补丁(Hotfix)信息的功能。
  • wusa 是 Windows 更新服务的主要命令,支持手动安装或卸载 .msu 更新文件。
  • msiexec 用于通过 MSI(Microsoft Installer)安装或卸载补丁,通常与 .msp 文件格式配合使用。
  • PowerShell 提供了强大的脚本支持,能够通过 Get-WindowsUpdateInstall-WindowsUpdate 等命令管理更新。
  • msdt.exe 用于启动 Windows 更新疑难解答工具,帮助自动修复更新相关的常见问题。

通过这些命令,用户可以有效地管理和控制 Windows 系统上的更新和 Hotfix,以确保操作系统保持最新的安全性和稳定性。


 

 

 

 

 

查看hotfix
`wmic qfe get hotfixid,installedon`
`Get-HotFix`
`wmic qfe list`
`Get-WmiObject -Class Win32_QuickFixEngineering`
`Get-WmiObject -Class "win32_quickfixengineering"`
`systeminfo`
`(New-Object -ComObject Microsoft.Update.Session).CreateUpdateSearcher().Search("IsInstalled=1").Updates | Select-Object Title`

posted @ 2023-11-13 02:41  suv789  阅读(258)  评论(0)    收藏  举报