Site icon Winhelponline

Change the Default Editor for Batch files in Windows

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

Change the Default Editor for Batch Files

  1. Launch the Registry Editor (regedit.exe)
  2. Navigate to the following branch:
    HKEY_CLASSES_ROOT\batfile\shell\edit\command
  3. Double-click the (default) value on the right.
  4. By default, it points to notepad.exe. Replace the existing data with the complete path of your editor.
    Example:
    "C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"

    Be sure to include the "%1" at the end (with quotes), as mentioned above.

  5. Optionally, to change the default editor for .CMD files as well, then make the change in the following key as well:
    HKEY_CLASSES_ROOT\cmdfile\shell\edit\command
  6. Exit the Registry Editor.

When you right-click on a Windows batch file and choose Edit, your chosen editor will now open the batch file for editing.

Exit mobile version