【发布时间】:2013-07-19 19:41:47
【问题描述】:
我正在编写以下代码以使用 PowerShell 关闭所有资源管理器窗口:
(New-Object -comObject Shell.Application).Windows() |
? { $_.FullName -ne $null} |
? { $_.FullName.toLower().Endswith('\explorer.exe') } | % { $_.Quit() }
但它不会关闭所有打开的窗口。
相反,它只关闭RoundDown(N/2)+1 窗口,而使RoundUp(N/2)-1 窗口保持打开状态。
有人可以帮忙吗?
【问题讨论】:
标签: powershell powershell-2.0 explorer