彻底解决win7系统右键选择打开方式中出现两个记事本选项的方法
在win7系统中经常会对文件选择右键菜单进行操作,而小编今天在右击文件选择打开方式的时候发现这样一个问题,就是右键菜单中出现了两个记事本的情况,这让小编很不解,后面网上查找了一下,其实这是很正常的一件事,那么如果不喜欢的话我们可以让它只剩下一个记事本,下面给大家带来彻底解决win7系统右键选择打开方式中出现两个记事本选项的步骤如下!
推荐:win7纯净版系统下载
原因分析:
因为在我们系统windows文件夹(C:\Windows)和system32文件夹(C:\Windows\System32)下面各有一个notepad.exe程序,系统在注册应用程序和文件关联打开方式的时候,分别使用了它们,但是打开方式又要读取这两个地方,所以就出现两个记事本了。
解决方法:
1、网站查找的方法:首先创建批处理,用来处理这个问题,把里面的代码复制粘贴到文本文件,保存为后缀。bat的文件,执行就可以了。
[email protected] off
if exist “%systemroot%\notepad.exe” set Npath=“%systemroot%\notepad.exe %%”1
if not exist “%systemroot%\notepad.exe” set Npath=“%systemroot%\system32\notepad.exe %%”1
reg add “HKCR\txtfile\shell\open\command” /ve /d %Npath% /t REG_SZ /f
reg add “HKCR\Applications\notepad.exe\shell\open\command” /ve /d %Npath% /t REG_SZ /f
reg add “HKCR\SystemFileAssociations\text\shell\open\command” /ve /d %Npath% /t REG_SZ /f
2、经小编测试,再加上翻阅资料,上述源码有误,应该是:
[email protected] off
if exist “%systemroot%\notepad.exe” set Npath=“%systemroot%\notepad.exe %”1
if not exist “%systemroot%\notepad.exe” set Npath=“%systemroot%\system32\notepad.exe %”1
reg add “HKCR\txtfile\shell\open\command” /ve /d %Npath% /t REG_SZ /f
reg add “HKCR\Applications\notepad.exe\shell\open\command” /ve /d %Npath% /t REG_SZ /f
reg add “HKCR\SystemFileAssociations\text\shell\open\command” /ve /d %Npath% /t REG_SZ /f
3、然后就可以解决win7系统右键选择打开方式中出现两个记事本选项了。
命令简单介绍:
if exist "%systemroot%\notepad.exe" set Npath="%systemroot%\notepad.exe %"1
这句话是设置一个变量: Npath="%systemroot%\notepad.exe %"1,这个变量将写入注册表。
%1 表示参数
比如你想打开1.txt,就是用 命令:notepad 1.txt搞定。
这个方法算是解决了txt后缀文件打开方式出现两个文件夹的问题。
总结:
我们在设置txt后缀打开类型的时候,
设置了HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\open\command=%systemroot%\notepad.exe
这就导致text类型直接映射到c:\Windows\notepad.exe
这时候包括ini文件inf文件在内的所有PerceivedType=text的文件类型映射到了c:\Windows\notepad.exe。
ini,inf文件的打开类型已经映射到了c:\Windows\System32\notepad.exe
这时候就会右键打开---出现两个记事本选项。。
解决的根本之道就是,将HKEY_CLASSES_ROOT\SystemFileAssociations\text\shell\open\command=%systemroot%\System32\notepad.exe
请使用命令:
@echo off
set Npath="%systemroot%\system32\notepad.exe %"1
reg add "HKCR\txtfile\shell\open\command" /ve /d %Npath% /t REG_SZ /f
reg add "HKCR\Applications\notepad.exe\shell\open\command" /ve /d %Npath% /t REG_SZ /f
reg add "HKCR\SystemFileAssociations\text\shell\open\command" /ve /d %Npath% /t REG_SZ /f
最后我们看看所谓的ini文件:
- 系统教程栏目
- win7系统教程排行
- 1 能用有效的win7旗舰版激活密钥永久激活码大全(100%激活)
- 2 2020最新office产品密钥永久激活码_office激活密钥永久key免费(附激活方法)
- 3 Win7旗舰版永久激活密钥 win7激活密钥序列号 win7激活神key大全
- 4 如何用硬盘安装Ghost系统
- 5 win7正版永久激活密钥2020_windows7产品密钥永久最新激活码
- 6 Win7激活码64位旗舰版最新 win7旗舰版64位激活密钥永久激活
- 7 32位和64位的win7系统的选择
- 8 win7电脑开机密码忘记了怎么办
- 9 最新win7虚拟机iso镜像文件下载|虚拟机专用win7 iso镜像下载包
- 10 已经安装迅雷 但是下载时还是提示需要安装迅雷
- 大家都在使用
- win7系统推荐
- 萝卜家园 ghost win7 32位 最新正版系统 v2022.12
- 萝卜家园 ghost win7 64位 一键装机版系统 v2022.12
- 大地系统 ghost win7 32位 官方正版系统 v2022.12
- 萝卜家园 ghost win7 32位 最新旗舰版系统 v2022.12
- 萝卜家园 ghost win7 64位 最新旗舰版系统 v2022.12
- 深度技术 ghost win7 32位 旗舰正式版系统 v2022.12
- 深度技术 ghost win7 32位 最新旗舰版系统 v2022.12
- 深度技术 ghost win7 32位 装机升级版系统 v2022.11
- 系统之家 ghost win7 64位 旗舰版系统 v2022.12
- 大地系统 ghost win7 64位 旗舰正版系统 v2022.12
- 最新教程