美文网首页
notepad++替换原有记事本

notepad++替换原有记事本

作者: 奔跑的苏立 | 来源:发表于2018-10-08 23:33 被阅读604次

刚在整理资料,突然发现我Ctrl+R命令然后notepad命令出来的记事本是Notepad2,于是找了一下,原来是以前弄过了使用Notepad2替代系统笔记本,于是就把我现在用的办法分享出来吧,希望能够帮助各位脱离微软万能不变的垃圾内置记事本吧

首先下面是我notepad2的目录文件:

**Notepad2_x64.exe **是主程序,Notepad2-mod(64-bit) 4.2.25 r985(7529a6b)
下载地址为:https://xhmikosr.github.io/notepad2-mod/

Notepad2_x64.ini 是程序配套的ini文件,一般就不用直接去改他吧,不过可以考虑设置好程序后对配置文件做备份吧。

脚本内容如下:

1、替换系统记事本.bat:

@ECHO OFF
PUSHD %~DP0
taskkill /f /im notepad*>NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行&&Pause >NUL&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion
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

2、恢复系统记事本.bat:

@ECHO OFF
PUSHD %~DP0
taskkill /f /im notepad*>NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行&&Pause >NUL&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion
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

注意:

1.脚本要与notepad2程序同一目录;
2.脚本使用系统管理员权限运行。

相关文章

网友评论

      本文标题:notepad++替换原有记事本

      本文链接:https://www.haomeiwen.com/subject/emysaftx.html