Struggling with IT problems and tired of overpriced local solutions? Choose my services for high-quality support at a price you control. Contact me today for a free, fair quote and exceptional service.

My Comment on ThioJoe’s Secrets of Windows Notepad

 |  ESTIMATED READING TIME:  1 MINUTE

Feel free to watch ThioJoe’s video through here.

Didn’t know a single one of those (except the obvious encoding stuff)+ I use Notepad++ with the Registry hack that replaces Notepad completely. Pretty cool though. I think I’ll remote into my cousin’s PC later to change the “When Notepad starts” setting to “Open a new window”, because I just loathe how he accidentally opens a million files with Notepad, even binaries that stay open from previous sessions forever.

If you’re on Windows 11, and you’re interested in making Notepad++ override regular Notepad completely, feel free to use the code below (for Notepad++ 64-bit version):


@ECHO OFF & CLS & ECHO.
NET FILE 1>NUL 2>NUL & IF ERRORLEVEL 1 (ECHO You must right-click and select &  ECHO "RUN AS ADMINISTRATOR"  to run this batch. Exiting... & ECHO. &  Timeout /t 10 & EXIT /B)
REM ... proceed here with admin rights ...
REM http://stackoverflow.com/questions/7044985/how-can-i-auto-elevate-my-batch-file-so-that-it-requests-from-uac-administrator
SETLOCAL
::
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /t REG_SZ /d "\"%ProgramFiles%\Notepad++\notepad++.exe\" -notepadStyleCmdline -z" /f

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\0" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad++.exe" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\1" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad++.exe" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\2" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad++.exe" /f

::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" /f


ENDLOCAL
GOTO :EOF

Technical Notes
Replace Notepad on Windows 11

The following code Reverses the change
```@ECHO OFF & CLS & ECHO.
NET FILE 1>NUL 2>NUL & IF ERRORLEVEL 1 (ECHO You must right-click and select &  ECHO "RUN AS ADMINISTRATOR"  to run this batch. Exiting... & ECHO. &  Timeout /t 10 & EXIT /B)
REM ... proceed here with admin rights ...
REM http://stackoverflow.com/questions/7044985/how-can-i-auto-elevate-my-batch-file-so-that-it-requests-from-uac-administrator
SETLOCAL


::Use the the following to Reset the default for Windows 11 notepad.exe to undo the replacement by Notepad++

reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v "Debugger" /f

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\0" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad.exe" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\1" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad.exe" /f
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe\2" /v "FilterFullPath" /t REG_SZ /d "%ProgramFiles%\Notepad++\notepad.exe" /f



ENDLOCAL
GOTO :EOF