Right-click context menu in Windows Explorer is always slow/hanging

I've created a solution that allows you to get the both of best worlds:

  1. Speed up right click menu by disabling Google Drive options from the context menu, but...
  2. Still allows you to access them when holding down the shift key. This is also typically known as the "extended" right-click context menu.

Normally this isn't necessary and can configured to work this way by just adding an Extended registry key. However, since Google Drive (a.k.a. Backup & Sync) utilizes the ContextMenuHandlers registry key (see below) it cannot be hidden without doing it permanently or using a hack/workaround like this one.

I write an AutoHotkey script to workaround this problem with pretty good results. Notice how the first click is very fast, but the second one is much slower (the main problem) but still at least allows access to the Google Drive context options. I've posted the code here along with detailed instructions on how to set it up:

Script: https://github.com/patricknelson/google-drive-context-fix

demo of fix

How it works:

Basically, this is a hack. It just bludgeons the registry keys necessary for showing these context menus depending on if you're A.) In Windows Explorer at the time and B.) currently pressing the shift key or not. It's not pretty, but it allows you to access the context options when you want to without having them enabled all of the time.

HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\GDContextMenu
HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\DriveFS 28 or later
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\GDContextMenu
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\DriveFS 28 or later