找到一个 PowerShell 方案, 但我没测试
来源 http://stackoverflow.com/questio ... ndows-in-powershell- $a = (New-Object -comObject Shell.Application).Windows() |
- ? { $_.FullName -ne $null} |
- ? { $_.FullName.toLower().Endswith('\explorer.exe') }
-
- $a | % { $_.Quit() }
复制代码 另有一个 AHK 方案, 测试通过, 不会 kill 掉 桌面, 因为只是关窗口, 并没有 kill explorer 的进程
来源 https://autohotkey.com/board/top ... l-explorer-windows/- GroupAdd,ExplorerGroup, ahk_class CabinetWClass
- GroupAdd,ExplorerGroup, ahk_class ExploreWClass
-
- ; close all Explorer windows when Winkey x pressed
- #x::
- if ( WinExist("ahk_group ExplorerGroup") )
- WinClose,ahk_group ExplorerGroup
- return
复制代码
|