You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在不终止explorer.exe的情况下关闭所有已打开的资源管理器窗口

Close All Open File Explorer Windows Without Restarting explorer.exe

Got it, you want to shut down all open File Explorer windows without killing or restarting the core explorer.exe process—totally get why that’s preferable, since restarting would reset your taskbar and pinned items. Here are two reliable, non-disruptive methods to do this:

Method 1: Use PowerShell

This command targets only the individual File Explorer window instances, leaving the main explorer.exe (the one running your taskbar/desktop) untouched:

(Get-Process explorer).MainWindowTitle | Where-Object { $_ -ne "" } | ForEach-Object {
    $targetWindow = Get-Process explorer | Where-Object { $_.MainWindowTitle -eq $_ }
    $targetWindow.CloseMainWindow()
}

Breakdown:

  • Get-Process explorer pulls all running explorer processes: the main taskbar process has an empty MainWindowTitle, while open File Explorer windows have titles matching their folder paths.
  • We filter out the main process by keeping only entries with non-empty window titles.
  • CloseMainWindow() sends a gentle "close" signal to each window—just like clicking the X button, no forced termination involved.

Method 2: Use a Double-Clickable VBScript

If you prefer a one-click solution, save this code as CloseAllExplorerWindows.vbs:

Set objShell = CreateObject("Shell.Application")
Set objWindows = objShell.Windows()

For Each objWindow In objWindows
    ' Verify the window is a File Explorer instance
    If InStr(objWindow.FullName, "explorer.exe") > 0 Then
        objWindow.Quit()
    End If
Next

How to use:

  1. Open Notepad, paste the code above.
  2. Save the file with a .vbs extension (make sure "Save as type" is set to "All Files" to avoid saving it as a .txt).
  3. Double-click the script, and all open File Explorer windows will close immediately.

Both methods will cleanly shut down your open folders without disrupting your taskbar, desktop icons, or the main explorer.exe process.

内容的提问来源于stack exchange,提问作者J. Hajjar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:36:47