Why does Explorer’s New menu take so long to appear the first time I open it?

Raymond Chen

When you right-click on an empty space in an Explorer folder and select the New menu item, there is sometimes a delay of up to two seconds before the menu appears. What’s going on during that delay?

The items in the New menu are discovered by looking for Shell­New subkeys in HKEY_CLASSES_ROOT.

This search takes some time, seeing as HKEY_CLASSES_ROOT is a rather large registry key. The New menu starts a background task to collect all the information and waits up to two seconds for it to report results. If the task doesn’t finish within two seconds, then the New menu gives up waiting and merely shows the result from the previous time the task ran, hoping that no new items were added in the meantime.

Meanwhile, the task continues to run and eventually completes with a list of items. If it finishes in time, the New menu will use it right away. Otherwise, it is saved for the New menu to use next time.

This is the similar sort of nonsense we went through with the COM component category catalog.