| 用途 | WMI 类命令行查询(legacy) |
|---|---|
| 语法 | wmic process where "name='x.exe'" get ProcessId,CommandLine |
| 替代 | Get-CimInstance / Get-Process(新脚本一律用新写法) |
常用示例
常用示例
wmic process where "name='explorer.exe'" get ProcessId,CommandLine
wmic service where "name='Spooler'" get Name,State,StartMode
wmic os get Caption,Version,LastBootUpTimewmic 已标记弃用并逐步从系统移除,兼容脚本请重写为 Get-CimInstance。