How to Set a Default Program for Opening a File

Here is how you can set Default Programs for opening Each File Type in Windows

Windows has its own way of identifying the function and purpose of each file. Unlike Linux, which uses separate bits (fields) to store information about a file’s purpose, like if it’s an executable or not, Microsoft uses a file’s extension to identify it’s type.

A file’s extension can be identified by the (usually) three characters that follow it’s name after a fullstop. For example, a text file usually has a .txt extension, while executables (files that execute when opened) are stored as .exe. Some applications like Microsoft’s Office suite have introduced their own extensions, like .doc or .docx for Microsoft Word and .xls and .xlsx for Microsoft Excel and more.

There’s no restriction or authority to get your extension approved and any developer can use their own extensions. However, it is common practice to use popular file extensions, like using .txt for text documents, and especially open source ones so a user can easily check what program can be used to open that certain type of file.


Windows comes with pre-defined preferences on how to open each file extension, like open .html documents with the default browser, .txt with the Notepad, and more. If a new program is installed, it is standard procedure to prompt the user to select if you want that program to be the default for opening files with a certain extension.

However, there are times when Windows picks a default that you don’t like. For example, the default browser in Windows is Internet Explorer (or the new Edge browser) and is used to open all web documents. If you want to change that, you will have to change the default for opening all web documents in Windows. In this guide, we will tell you how you can change that.

Change Defaults for Different Extensions

There are two ways you can do this. First, you can simply go and right-click on any file that you want to open with a certain program. Here, we want to set all .txt files to open by default with Visual Studio Code, a superior text editor specifically designed for developers.

  1. Right-click on a .txt file.
  2. Click on Open with.
  3. Click on Choose another program.
  4. From the list of suggested programs, select your program. If you don’t see your preferred program in the given list, click on Look for another app on this PC. Browse for the program you want to choose and select its .exe file. It is usually placed in Program Files > Name of your Program.
  5. Check the checkbox at the bottom that says ‘Always use this program to open .txt files’.
  6. Click on Ok.

That’s it. All .txt files will now be shown with an icon of the program that’s the default for them and will open with that program when double-clicked.

Choose Defaults for Different Windows Applications

You can also set defaults for different programs by going to the Windows Settings.

  1. Open Settings (keyboard shortcut START + I).
  2. Click on Apps.
  3. From the left pane, click on Default apps.
  4. In the right-pane, you will see a list of default apps like Email, Maps, Music Player, Photo Viewer, Video Player, and Web Browser. Whichever you want to change, click on it and it will suggest you alternative applications or allow you to look for an alternative in the Windows App Store.