When you right-click on a .BAT file and click Edit, by default Notepad opens the file. If you have a Notepad replacement tool installed in your system, you can set it as the default editor for batch files.

As the File Types tab (Control PanelFolder OptionsFile Types) in Windows XP does not list .BAT file type by default, you need to edit the registry to change the Edit verb’s default action. And remember, Windows Vista does not even have the File Types tab.

Set the Default Editor for Batch Files

1. Click Start, Run and type regedit.exe

2. Navigate to the following branch:

HKEY_CLASSES_ROOT \ batfile \ shell \ edit \ command

3. Double-click the (default) value in the right-side.

4. By default it points to Notepad.exe. Simply replace the existing data with the complete path of your Notepad replacement tool.

5. Don’t forget to include the "%1" at the end (with quotes, as in the above figure). The syntax is:

"filename" (space) "%1"

6. Exit the Registry Editor.

When you right-click on a MS-DOS batch file and choose Edit, your preferred editor will now open the batch file.

Undo Information

To restore the default values back (Notepad as the default editor), use the above steps and set "C:\Windows\Notepad.exe" "%1" as the (default) value. Alternately, you can use file bat-edit-notepad.reg to reset it to Notepad.

Related Posts


Email SubscriptionPrefer an E-mail subscription?

Enter your email address:

Delivered by FeedBurner

Leave a Reply