首页 > 系统相关 >Replacing Windows Notepad with Notepad2 4.1.24 (or newer)

Replacing Windows Notepad with Notepad2 4.1.24 (or newer)

时间:2023-04-25 13:01:26浏览次数:42  
标签:24 exe 4.1 Replacing Notepad Windows HKCR Notepad2 reg


Replacing Windows Notepad with Notepad2 4.1.24 (or newer)

As of version 4.1.24, the official release of Notepad2 supports this method for replacing Windows Notepad, so the steps outlined above will work fine. However, there's no support to perform the Notepad replacement automatically, as the official release of Notepad2 will not modify the system registry. For the same reason, there's no support for accessing recent files through the Windows 7 jump lists, by default (this requires registration of applications in the system registry, first).

Also be aware that automated Notepad replacement could have undesirable effects if Notepad2 was used as a Notepad replacement from a portable device, and the original state was not restored when disconnecting the device.

A batch script to run from the Notepad2 directory and replace Windows Notepad might look like this (requires elevated privileges):


reg add "HKLM/Software/Microsoft/Windows NT/CurrentVersion/Image File Execution Options/notepad.exe" /v "Debugger" /t REG_SZ /d "/"%~dp0Notepad2.exe/" /z" /f


The Windows Notepad can be restored with this command (requires elevated privileges):


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


Enable Jump List Support

A few more tweaks are needed to enable recent file access through the jump lists introduced with Windows 7. First, register Notepad2 as an "Open with" handler using the following batch script (run from the Notepad2.exe directory with elevated privileges):

reg add "HKCR/*/OpenWithList/Notepad2.exe" /f
reg add "HKCR/Applications/Notepad2.exe" /v "AppUserModelID" /t REG_SZ /d "Notepad2" /f
reg add "HKCR/Applications/Notepad2.exe/shell/open/command" /ve /t REG_SZ /d "/"%~dp0Notepad2.exe/" %%1" /f

Next, apply the following changes to the Notepad2.ini file:

[Settings2]
...
ShellAppUserModelID=Notepad2
ShellUseSystemMRU=1

Recent files now appear in the jump lists. Notepad2 windows are now assigned to a custom AppUserModelID, that's why multiple icons may appear if Notepad2.exe is directly pinned to the taskbar. To fix this, open a Notepad2 window first, and then pin it to the taskbar from the Notepad2 taskbar button context menu.

Unregister the Notepad2 "Open with" handler with the following script (requires elevated privileges):

reg delete "HKCR/*/OpenWithList/Notepad2.exe" /f
reg delete "HKCR/Applications/Notepad2.exe" /f

标签:24,exe,4.1,Replacing,Notepad,Windows,HKCR,Notepad2,reg
From: https://blog.51cto.com/u_15408625/6223790

相关文章

  • 虚拟机热迁移一直处于迁移中的状态-v4-20210308_124243
    虚拟机热迁移一直处于迁移中的状态企业云平台产品中心共享知识库Exportedon03/08/2021TableofContents问题现象:对虚拟机进行热迁移操作,Dashboard和云服务自助平台上一直处于迁移中的状态问题原因:虚拟机存在频繁的数据读写操作,导致虚拟机迁移的速度追不上数据读写的速度,每次迁......
  • OSD自然OUT之后无法再加入集群-v1-20210308_124828
    OSD自然OUT之后无法再加入集群企业云平台产品中心共享知识库Exportedon03/08/2021TableofContents问题描述4问题原因5解决方法6验证步骤6相关下载链接:OSD自然OUT之后无法再加入集群.pdf1--------这是一条华丽的分割线--------1https://iwiki.woa.com/dow......
  • 【20230424】logstash生产开发总结汇总
    logstash生产开发总结汇总本文主要讲使用Logstash生产开发操作、遇到问题及处理时间:20230424logstash版本:logstash7.8.1官网:https://www.elastic.co/cn/logstash/目录logstash生产开发总结汇总一、基础开发简单的启动脚本字段过滤解析Json嵌套时间转换类templa......
  • 4.24
    这里需要设计一个捐款人类Donator及一个相关函数getMaxName(),Donator类中包含捐款人的姓名及其捐款额,其部分代码如下:classDonator{private:stringname;//捐款人姓名floatmoney;//捐款金额,单位:元public:voidsetName(string_......
  • 4.24
    问题描述:对N个整数《数据由键盘输入》进行升序排序问题分析:1、用数组a[100010]储存这Ⅳ个数2、定义j=1,在z<N进行循环3、在循环中定义i-o,在i<N-j进行循环4、每次循环比较a叫与a[i+1]的大小。如果a门>a[i+1],这进行交换5、输出三、流程图四、代码示例#include<bits/stdc......
  • 2023-04-24 算法面试中常见的贪心算法问题
    贪心算法1贪心选择例题455.饼干分配假设你想给小朋友们饼干。每个小朋友最多能够给一块儿饼干。每个小朋友都有一个“贪心指数”,称为g(i),g(i)表示的是这名小朋友需要的饼干大小的最小值。同时,每个饼干都有一个大小值s(i)。如果s(j)>=g(i),我们将饼干j分给小朋友i后,小朋友就会......
  • 2023/4/24
    L1-003个位数统计分数 15全屏浏览题目作者 陈越单位 浙江大学给定一个 k 位整数 N=dk−1​10k−1+⋯+d1​101+d0​ (0≤di​≤9, i=0,⋯,k−1, dk−1​>0),请编写程序统计每种不同的个位数字出现的次数。例如:给定 N=100311,则有2个0,3个1,和......
  • 4.24总结
    --基础查询--1.查询多个字段/*1.查询多个字段SELECT字段列表FROM表名;SELECT*FROM表名;--查询所有数据去除重复记录SELECTDISTINCT字段列表FROM表名;3.起别名AS:AS也可以省略*/droptableifexistsstu;CREATETABLEstu(idint,namevarchar(20),......
  • 2023.4.24记录
    声明抽象基类Shape,由它派生出三个类,圆形Circle,矩形Rectangle,三角形Triangle,用一个函数输出三个面积。输入格式:在一行中依次输入5个数,圆的半径,长方形的高和宽,三角形的高和底,中间用空格分隔输出格式:圆的面积,长方形的面积,三角形的面积,小数点后保留2位有效数字,每个面积占一行。......
  • 2023.4.24
     1//实验五任务二2#include<iostream>3usingnamespacestd;4classvector3D5{6private:7floatx,y,z;8public:9vector3D()10{11x=0;12y=0;13z=0;14}15friendostream&oper......