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.
Bookmark this Page!
BlinkList | del.icio.us | Digg it | Furl | reddit | Spurl | StumbleUpon |
Related Posts
- 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
- Apply the Default User Logon Picture to All Users in Vista
- Edit the Information Displayed in the “Type” Column of Details View in Folders
- Add SnagIt Editor to the Right-Click Menu for Image Files
- Fix: The Default Icon for .VBS Files Changed by Virus/Worm
- How to Change the Icon for a File Type in Windows 7 and Vista
- Prevent Desktop Background (Wallpaper) Change When Applying a Desktop Theme
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?

› 