NotepadReplacer is a Windows Notepad replacement tool. It forwards calls to notepad.exe to a text editor selected by the user and adds an “Open with Notepad” context-menu command to File Explorer on Windows 11.
The installer handles target-program selection, removal of the Microsoft Store version of Notepad, system configuration, context-menu deployment, and uninstall cleanup. NotepadReplacerLauncher is the lightweight component that forwards process calls; it is not the name of the project itself.
- Forward calls to
notepad.exeto a specified.exeprogram. - Deploy the Launcher for the system architecture; on 64-bit systems, configure both 32-bit and 64-bit IFEO registry views.
- Escape and forward valid arguments according to Windows command-line rules, including spaces, quotes, and backslashes.
- Add an “Open with Notepad” command to the top-level File Explorer context menu on 64-bit Windows 11.
- Open multiple selected files from the context menu in one operation.
- Provide Chinese and English installer interfaces, with rollback on installation failure and cleanup during uninstall.
- Run
NotepadReplacerSetup.exeas an administrator. - Select the executable file that should replace Windows Notepad, such as the
.exefile of another text editor. - Confirm removal of the Microsoft Store version of Notepad and wait for installation to finish.
- Files opened through
notepad.exewill then be forwarded to the selected program. On supported Windows 11 systems, you can also use “Open with Notepad” from the File Explorer context menu.
The installation directory is fixed at Program Files\NotepadReplacer on the system drive. The target program path is stored at:
HKEY_LOCAL_MACHINE\SOFTWARE\NotepadReplacer\TargetPath
- The installer requires administrator privileges.
- Installation removes the Microsoft Store version of Notepad installed for the current user and removes its corresponding provisioned package from the system.
- Uninstalling NotepadReplacer does not automatically restore the Microsoft Store version of Notepad. Reinstall it manually from the Microsoft Store if needed.
- The selected replacement program must remain at its original path. Forwarding and the context menu will not work correctly if the file is moved or deleted.
- If an IFEO Debugger configuration for
notepad.exealready exists and does not belong to this project, installation stops to avoid overwriting it. - The complete x64 installation requires 64-bit Windows 11 (Build 22000 or later). Installation rolls back if the context-menu package cannot be registered.
NotepadReplacer consists of the installation/configuration flow, a process-forwarding component, and Windows 11 context-menu components:
| Component | Responsibility |
|---|---|
NotepadReplacerSetup.exe |
Selects the target program, removes Store Notepad, deploys files, writes IFEO and the target path, and handles rollback and uninstall |
NotepadReplacerLauncher |
Receives IFEO Debugger arguments, removes the notepad.exe path added by Windows, then forwards the remaining arguments to the target program |
NotepadReplacerContextMenu.dll |
Implements the Windows 11 File Explorer command and passes selected files to the configured target program |
NotepadReplacer.msix |
Registers the context-menu command and COM component through the windows.fileExplorerContextMenus extension |
The installer writes the architecture-specific Launcher to the following IFEO configuration:
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe
The call flow is:
An application or command line calls notepad.exe
-> Windows starts NotepadReplacerLauncher through IFEO
-> The Launcher removes the extra IFEO arguments
-> The Launcher creates the selected target process and exits immediately
The context menu does not go through notepad.exe. It reads the target path saved by the installer, starts the target program directly, and passes all selected files to it.
- Visual Studio 2022 with the “Desktop development with C++” workload
- CMake 3.21 or later
- Windows 10/11 SDK
- Inno Setup 6 (only required to build the installer)
Run the build script to generate the x64 Launcher, x64 context-menu DLL, and x86 Launcher required by the installer:
powershell -ExecutionPolicy Bypass -File .\build.ps1The script builds the Release configuration and uses the static MSVC runtime by default. Use -Configuration Debug for another configuration, or -DynamicRuntime to use the dynamic runtime (the target system must have the corresponding Visual C++ Runtime installed).
All build outputs are written to dist: the x64 and x86 CMake build directories are dist\x64 and dist\x86, respectively, and the context-menu package is located at dist\context-menu-package.
To build only the Launcher, disable the Windows 11 context-menu component:
cmake -S . -B dist/x64 -G "Visual Studio 17 2022" -A x64 -DNOTEPADREPLACER_BUILD_CONTEXT_MENU=OFFRun the tests:
ctest --test-dir dist/x64 -C Release --output-on-failureAfter completing the x64 and x86 Release builds, run:
powershell -ExecutionPolicy Bypass -File installer/build-installer.ps1The script performs the following steps:
- Checks for the x86 and x64 Launchers and the x64 context-menu DLL.
- Uses the Windows SDK
MakeAppx.exeto create the MSIX package. - Signs the MSIX with
SignTool.exeand exports the certificate required during installation. - Calls Inno Setup's
ISCC.exeto generate the final installer.
The output file is:
dist\NotepadReplacerSetup.exe
Before building the installer for the first time, generate a fixed self-signed certificate locally:
powershell -ExecutionPolicy Bypass -File installer/New-SigningCertificate.ps1The generated PFX, password, and Base64 files are placed in .certificates, which is ignored by Git. build-installer.ps1 prefers the local NotepadReplacer.pfx and NotepadReplacer.password; if they are unavailable, it uses the WINDOWS_CERTIFICATE (Base64 PFX) and WINDOWS_CERTIFICATE_PASSWORD environment variables.
For GitHub Actions, save the contents of .certificates/NotepadReplacer.pfx.base64 as the repository secret WINDOWS_CERTIFICATE, and the contents of .certificates/NotepadReplacer.password as WINDOWS_CERTIFICATE_PASSWORD. Local and remote builds will then use the same certificate.
When installing the context menu, the installer adds the MSIX signing certificate to the local TrustedPeople certificate store and removes the certificate during uninstall.
If registration of the Windows 11 context menu fails, the installation rolls back. Detailed PowerShell and AppX errors are recorded at:
%ProgramData%\NotepadReplacer\context-menu.log
The Launcher is a Windows subsystem program and does not display a console window. It exits immediately after creating the target process; it does not wait for the target program to finish.
This project is licensed under the GNU General Public License v3.0 or later and is subject to the GPLv3 Section 7 Additional Terms. You may use, study, modify, and distribute this software. When distributing the original or a modified version, you must provide the complete corresponding source code under the GPL, retain applicable notices, and must not distribute GPL-covered derivative works as closed source.
The Additional Terms require retaining the statement that the original materials were AI-assisted and developed through vibe coding, and prohibit misrepresenting the original materials as having been created entirely through traditional manual programming, without AI, or as “non-vibe coding.” Modifiers may truthfully describe the development methods used for their independently created portions.
replacer.ico and installer/logo.png are third-party assets and are not relicensed by the statements above. Redistributors must comply with the original rights holders' licenses or replace these assets with materials they are authorized to distribute.
replacer.ico and installer/logo.png are sourced from Iconbuddy.
