Saturday 10 October 2020

How do we replace Notepad with Notepad++?

 
You can run the following command to make Notepad++ replace Notepad (run in cmd.exe with Administrator privileges):
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%ProgramFiles(x86)%\Notepad++\notepad++.exe\" -notepadStyleCmdline -z" /f
Note that you may need to use
"%ProgramFiles%\Notepad++\"
to substitute for
"%ProgramFiles(x86)%\Notepad++\"
If you have Notepad++ 64-bit installed, or use other path if your Notepad++ is installed in a non-default location.
Use the the following comment to undo the replacement:
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger"