notepad++替换原有记事本

刚在整理资料,突然发现我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.脚本使用系统管理员权限运行。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 个人学习批处理的初衷来源于实际工作;在某个迭代版本有个BS(安卓手游模拟器)大需求,从而在测试过程中就重复涉及到...
    Luckykailiu阅读 4,792评论 0 11
  • .bat脚本基本命令语法 目录 批处理的常见命令(未列举的命令还比较多,请查阅帮助信息) 1、REM 和 :: 2...
    庆庆庆庆庆阅读 8,224评论 1 19
  • ----------------------- 页面 1----------------------- 2013 ...
    长春傳齐3阅读 4,906评论 0 1
  • 文件格式(或文件类型)是指电脑为了存储信息而使用的对信息的特殊编码方式,是用于识别内部储存的资料。比如有的储...
    一只不靠谱的猿_阅读 3,872评论 0 10
  • 部分内容转载自搜狗百科 cmd是command的缩写.即命令提示符(CMD),是在OS / 2 , Windows...
    青冥之上阅读 2,429评论 0 24