Thursday, 25 February 2010

Changing default editor for batch scripts.

Right clicking on a .bat or .cmd file and select edit will open the file in the default program, Notepad. I prefer to use a different editor. To change the default for these files requires a registry change:
  1. Open the registry editor (regedit.exe)
  2. Browse to HKEY_CLASSES_ROOT\batfile\shell\edit\command
  3. Edit the default value and change to the executable you want to use to edit the batch files,
    e.g. "C:\Program Files\Programmer's Notepad\pn.exe" "%1"
  4. Click OK
  5. Browse to HKEY_CLASSES_ROOT\cmdfile\shell\edit\command
  6. Edit the default value and change to the executable you want to use to edit the command files.
  7. Click OK
No restart required.

No comments: