JSI Tip 5264. How do I change the double-click action, the default, for a file type, using Windows XP?

The default action that happens when you double-click a file in Windows XP Explorer, or My Computer, is defined by the files extension. All files of the same extension have the same default action.

NOTE: The most common default action is Open, which launches the associated program and uses the file you double-clicked.

NOTE: To determine the default action of a file type, right-click a file with that extension. The default action is in boldface type.

You may wish to change the default action. You can change the default of a batch file (.bat extension) from Open to Edit, which will prevent the file from accidentally running when you double-click it.

To change the default action:

1. Control Panel / \[Appearance and Themes\] / Folder Options.

2. Select the File Types tab.

NOTE: If you can't find the extension, see Using the Registry on this page.

3. Press the file extension for which you want to change the default action.

4. Press the Advanced button. 

5. Press the command that you want to make the default action and press the Set Default button.

6. Press OK and then exit the dialog.

Using the Registry

To set the default action, using the registry:

1. Open a CMD prompt and type:

assoc .<extension>

Example: assoc .bat

This will return:


2. Use regedit.exe to navigate to:


where batfile is the string returned from step 1.

3. Double-click the (Default) Value Name and set the data value of this string to the name of the default action.

Example: Set the (Default) string to edit.

4. Exit the Registry Editor.

NOTE: You can also create a .reg to set the default action, and then run it, regedit /s filename.reg:



Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.