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 Panel – Folder Options – File 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:
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
- Using Default Programs Editor to Change File Type Icons in Windows 7 and Windows Vista
- Default Programs Editor – A Useful File Association Editor for Windows 7 and Vista
- Change the Default Icon for Unknown File Types in Windows Vista
- Change the Open Folder Icon in Windows Explorer and Registry Editor
- The Default View Source Editor Has Changed in Internet Explorer 8
If you enjoyed this post, make sure you subscribe to our RSS feed! We feature Tips, Troubleshooting information, Scripts and Utilities for Microsoft Windows Operating Systems!
Prefer an E-mail subscription?




