Posey's Tips & Tricks

How To Fix a Missing File Explorer Shortcut

Here's how to restore missing context menu options and file associations in Windows when File Explorer shortcuts

As strange as it might sound, Notepad has always been my editor of choice for writing PowerShell code. Sure, Notepad lacks a lot of the features that are found in other code editors, but I like Notepad's minimalistic interface. It lets me take full advantage of my screen real estate and I don't get distracted by options, features, or panes that I don't need.

Any time that I get ready to write a new PowerShell script, I have gotten in the habit of right clicking in my Scripts folder and choosing the New > Text Document commands from the shortcut menu. This is something that I do all the time, and yet this morning the option was missing for some reason. As such, I wanted to talk about what's involved in fixing missing shortcut menu options and file extension problems, since the two are closely related.

Before you try to fix the problem, I recommend rebooting your PC. I have occasionally seen Windows do weird things that things that were corrected by a reboot. If you've got a bunch of windows open and don't want to deal with the hassle of a reboot then there is another option. However, it's a good idea to save anything that you are working on, just in case things don't quite go as planned.

Rather than rebooting the machine, you can restart the Windows Explorer process. To do so, just open Task Manager, right click on Windows Explorer, and select the Restart option. This will cause any open copies of File Explorer to close. The Windows Explorer process will restart and you can immediately open File Explorer to see if the problem has been resolved.

Somewhat surprisingly, restarting the Windows Explorer process fixed the issue on my machine. As soon as I restarted Windows Explorer, the New > Text Document option returned. Although I got lucky this time, the usual fixes have the potential to cause harm. Therefore, I recommend making a full system backup before moving forward.

One of the first things that I would recommend doing in an effort to fix your problems is to open Settings and then click on Default Apps. Next, click on the application that is causing you problems. This will cause Windows to display the file associations for the application. If a file association is incorrect, you can reset it through this screen.

Next, go back to the Apps screen and click on Installed Apps. Locate the app that is causing problems and then click the more icon (the three dots).  When prompted, click on Advanced Options. The resulting Advanced Options screen includes buttons that you can use to repair or reset the app. Be careful using these options since the reset button can cause data loss for some apps.

If you have thus far been unable to fix the problem, then you may need to delve into the Windows registry. Before I explain how you would go about fixing a registry problem, I need to point out that modifying the Windows Registry can be dangerous. Making a mistake while editing the registry can destroy Windows and / or your applications. As such, it's important to make sure that you have a backup.

So with that said, context menu options are treated as shell extensions and are configured within the Windows registry. These registry settings don't usually just disappear for no reason. However, it is relatively common for a newly installed program to hijack commonly used file extensions (such as the .TXT extension used by Notepad) and to modify related shortcut menu options.

To address the problem, open the Windows Registry Editor, expand HKEY_CLASSES_ROOT. From there, you will need to click on the key that corresponds to the file extension that you are having trouble with. In my case, this is the .TXT key. Upon doing so, take a moment to make sure that the file type is still being correctly recognized. In the case of the .TXT extension for instance, you would need to make sure that the extension is still being used for text files, as shown in Figure 1. If the values shown within the Registry Editor are incorrect, then copy the correct values from a machine that is functioning properly.

Figure 1
<File Extensions 1.jpg>
Make sure that your file extensions are still being treated as the correct file type.

[Click on image for larger view.] Figure 1. Make sure that your file extensions are still being treated as the correct file type.

As you look at the figure above, you will notice that the default value is txtfilelegacy. As such, my next step would be to navigate to HKEY_CLASSES_ROOT\txtfilelegacy\shell. It's worth noting that this location is found quite a bit further down in the registry hierarchy. The Shell folder should contain a subfolder that refers to a command name such as New, Print, or something like that. Expand the folder and then click on the Command folder. This folder should include a command that associates the file extension with an application (in this case, Notepad). You can see an example in Figure 2. Again, if this part of the registry is messed up then you can copy the correct data from a healthy PC.

[Click on image for larger view.] Figure 2. There should be a command that references the application that is associated with the file extension.

Hopefully, this will help you to fix the problem, but if not then you might try using a free tool called ShellExView (https://www.nirsoft.net/utils/shexview.html).  Many of its capabilities already exist natively in Windows, but some people claim to have better luck using this tool to fix applications and file extensions than using the native tools. You can see what the tool looks like in Figure 3. Keep in mind that you will need to run this tool as an administrator in order to take advantage of its full capabilities.

Figure 3
<File Extensions 3.jpg>
ShellExView can help you to track down problems related to file extensions.

figure>
[Click on image for larger view.] Figure 3. ShellExView can help you to track down problems related to file extensions.

About the Author

Brien Posey is a 22-time Microsoft MVP with decades of IT experience. As a freelance writer, Posey has written thousands of articles and contributed to several dozen books on a wide variety of IT topics. Prior to going freelance, Posey was a CIO for a national chain of hospitals and health care facilities. He has also served as a network administrator for some of the country's largest insurance companies and for the Department of Defense at Fort Knox. In addition to his continued work in IT, Posey has spent the last several years actively training as a commercial scientist-astronaut candidate in preparation to fly on a mission to study polar mesospheric clouds from space. You can follow his spaceflight training on his Web site.

Featured

comments powered by Disqus

Subscribe on YouTube