添加∕删除右键菜单

@ECHO OFF
PUSHD %~DP0
TITLE Notepad2-Mod 汉化版(添加/删除右键菜单)
SET /P ST=输入y添加右键菜单,输入n删除右键菜单:
if /I "%ST%"=="y" goto Add
if /I "%ST%"=="n" goto Remove
:Add
reg add "HKEY_CLASSES_ROOT\*\shell\NotePad2" /ve /t REG_SZ /d "用 &NotePad2 打开" /f
if not exist "%WinDir%\SysWOW64" reg add "HKEY_CLASSES_ROOT\*\shell\NotePad2\command" /ve /t REG_SZ /d "\"%~dp0Notepad2.exe\" ""%%1""" /f
if exist "%WinDir%\SysWOW64" reg add "HKEY_CLASSES_ROOT\*\shell\NotePad2\command" /ve /t REG_SZ /d "\"%~dp0Notepad2_x64.exe\" ""%%1""" /f
exit
:Remove
reg delete "HKEY_CLASSES_ROOT\*\shell\NotePad2" /f
exit

替换系统记事本

@ECHO OFF
PUSHD %~DP0
taskkill /f /im notepad*>NUL 2>NUL
if not exist "%WinDir%\SysWOW64" reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v Debugger /t REG_SZ /d "\"%~dp0Notepad2.exe\" /z" /f
if exist "%WinDir%\SysWOW64" reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /v Debugger /t REG_SZ /d "\"%~dp0Notepad2_x64.exe\" /z" /f

恢复系统记事本

@ECHO OFF
PUSHD %~DP0
taskkill /f /im notepad*>NUL 2>NUL
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /f
reg delete "HKLM\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\notepad.exe" /f
exit