您现在的位置是:主页 > 系统教程 > 笔者操作win10系统右键选择打开方式中出现两个记事本选项的办法

笔者操作win10系统右键选择打开方式中出现两个记事本选项的办法

发布日期:2019-10-24      作者:win10纯净版      来源:http://www.wp10.cc 复制分享

    今天和大家分享一下win10系统右键选择打开方式中出现两个记事本选项问题的解决方法,在使用win10系统的过程中经常不知道如何去解决win10系统右键选择打开方式中出现两个记事本选项的问题,有什么好的办法去解决win10系统右键选择打开方式中出现两个记事本选项呢?小编教你只需要1、网站查找的方法:首先创建批处理,用来处理这个问题,把里面的代码复制粘贴到文本文件,保存为后缀。bat的文件,执行就可以了。  2、经小编测试,再加上翻阅资料,上述源码有误,应该是:就可以了;下面就是我给大家分享关于win10系统右键选择打开方式中出现两个记事本选项的详细步骤::

推荐:

 

win10系统右键选择打开方式中出现两个记事本选项的解决方法

原因分析:

    因为在我们系统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、然后就可以解决win10系统右键选择打开方式中出现两个记事本选项了。

 

win10系统右键选择打开方式中出现两个记事本选项的解决方法

命令简单介绍:

if exist "%systemroot%/notepad.exe" set npath="%systemroot%/notepad.exe %"1

这句话是设置一个变量: npath="%systemroot%/notepad.exe %"1,这个变量将写入注册表。

win10系统右键选择打开方式中出现两个记事本选项的解决方法

%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文件:

 

win10系统右键选择打开方式中出现两个记事本选项的解决方法

    好了,以上给大家介绍的就是彻底解决win10系统右键选择打开方式中出现两个记事本选项的方法,大家可以尝试上面的方法进行解决就可以了。

 


栏目专题推荐
win10纯净版推荐
雨林木风WinXP 热门2021元旦装机版
热门教程
win10系统开启前面板耳机的设置方案
友情链接