首页 > 电脑教程
老司机设置win7系统右键选择打开方式中出现两个记事本选项的还原步骤
2021-12-16 12:06:04 电脑教程今天教大家一招关于win7系统右键选择打开方式中出现两个记事本选项的解决方法,近日一些用户反映win7系统右键选择打开方式中出现两个记事本选项这样一个现象,当我们遇到win7系统右键选择打开方式中出现两个记事本选项这种情况该怎么办呢?我们可以1、网站查找的方法:首先创建批处理,用来处理这个问题,把里面的代码复制粘贴到文本文件,保存为后缀。bat的文件,执行就可以了。 2、经小编测试,再加上翻阅资料,上述源码有误,应该是:下面跟随小编脚步看看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系统右键选择打开方式中出现两个记事本选项如果你也有遇到这样的情况,就可以采取上面的方法步骤来进行解决,小编就讲解到这里了,我们下期再会!
相关教程推荐
- 2021-11-18 win7遇到关键问题,window已经遇到关键
- 2021-11-28 win7右键菜单,win7右键菜单没有打开方式
- 2021-12-06 IE浏览器 win7,ie浏览器 win10
- 2021-12-04 win7 sp1,win7 sp1什么意思
- 2021-12-03 图文为你xp系统恢复右键菜单发送到项目的设置方
- 2021-08-09 小编破解xp系统恢复右键菜单发送到‘项目’的具
- 2021-09-27 快速讲解xp系统添加管理员身份运行到右键菜单的
- 2021-12-08 手把手分析xp系统右键添加“管理员取得所有权”
- 2021-11-18 大神应对xp系统右键添加“复制/移动到文件夹”
- 2021-11-23 高手分析xp系统使用保存右键无法保存图片的处理