Windows explorer folder context menu closes itself
Environment: Windows 8.0 Professional x64
When I call up the context menu on a selected folder in the listview (actual view mode doesn't matter, I reproduce for list, icons, and details), either via right-click or the context-menu button on my keyboard, the menu appears and then vanishes a second later.
It doesn't happen for all folders. It doesn't happen for drives. It doesn't happen in the folder tree pane.
If it happens for a folder inside a Documents library, it happens for both paths rooted at Libraries and filesystem paths.
The effect is similar to this question but I am in a different environment and it's happening to different folders.
I presume that a shell extension is causing an error/exception during context menu processing, and Explorer responds by destroying the menu. Are such errors logged anywhere? How can I discover what extension is failing?
The laptop where I'm observing this does suffer from Task Manager sporadically closing itself on launch, and also instability caused by overheating, but this problem is 100% reproducible so I don't think it is heat-related.
In my case the reason was Google Drive Backup & Sync was running. As soon as I stopped it, my context menu was not disappearing anymore.
It doesn't happen for all folders. It doesn't happen for drives. It doesn't happen in the folder tree pane.
Is there anything different between the folders it happens with and the ones it doesn’t (e.g., do some contain media files or desktop.ini
or have different attributes set or something)?
I presume that a shell extension is causing an error/exception during context menu processing, and Explorer responds by destroying the menu.
If you can definitively rule out the Escape key and narrow down the problem to just the context-menu of folders, then it is indeed likely one of the folder-only shell-extensions. Like you surmised, what’s probably happening is that something you installed recently added a context-menu to folders, but the context-menu handler is poorly written and has a bug, so whenever it triggers, it is causing a problem, probably while trying to create a submenu or use an icon. (You’re lucky that all it’s doing is closing the menu and not outright crashing Explorer.)
Are such errors logged anywhere?
It don’t believe that there is specifically a shell-extension-failure logging function, but you can check the Event Log (Run ⇨ eventvwr
). If there’s anything, it will probably be under the Windows Logs ⇨ Applications branch, possibly with a source of Application Popup
or Application Error
.
How can I discover what extension is failing?
You can use ShellExView to determine which extension is the culprit.
- Run ShellExView
- Click the File Extensions column to sub-sort by hook
- Click the Type column to sort by extension type
- Scroll down to the entries that contain
Folder
orDirectory
in the File Extensions column (look carefully because they can be mixed in with a bunch of other hooks; you can check the entry’s Properties dialog to see the field in a navigable edit control) - Disable one (right-click ⇨ Disable or select, F7)
- You may need to restart Explorer.
Test to see if it still happens. If so, repeat for the next one. You can also disable multiple/all items by holding the Ctrl key, but then you would have to re-enable them one-by-one to determine which one was causing the problem, so you may as well disable them one at a time.