我正在编写以下代码以使用 PowerShell 关闭所有资源管理器窗口:
(New-Object -comObject Shell.Application).Windows() |
? { $_.FullName -ne $null} |
? { $_.FullName.toLower().Endswith('\explorer.exe') } | % { $_.Quit() }
但它不会关闭所有打开的窗口。相反,它只关闭RoundDown(N/2)+1
窗口,并让RoundUp(N/2)-1
窗口保持打开状态。
有人能帮忙吗?