windows7之家--为你提供最新官方原版win7旗舰版纯净版iso系统下载站

网站地图win7激活工具 如何安装系统加入收藏

时间:2017-10-24 16:34 来源:windows之家浏览量:166

        win7系统会出现这样的情况,那就是打开右键菜单栏的记事本时会出现两个!一一点进去发现根本没有什么区别,都是记事本的功能,那么为什么会有两个选项呢?又该如何删除其中一个记事本呢?想了解的朋友可以看看下面的操作方法,可以有效的解决大家遇到的两个记事本问题:

为什么Win7右键”打开方式“会出现两个记事本选项
 
  原因分析:

  因为在我们系统windows文件夹(C:\Windows)和system32文件夹(C:\Windows\System32)下面各有一个notepad.exe程序,系统在注册应用程序和文件关联打开方式的时候,分别使用了它们,但是打开方式又要读取这两个地方,所以就出现两个记事本了。

  解决方法:

  1、首先创建批处理,用来处理这个问题,把里面的代码复制粘贴到文本文件,保存为后缀.bat的文件,执行就可以了。

  @echo 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、然后就可以解决右键选择打开方式中出现两个记事本选项了。

  命令简单介绍:

  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右键“打开方式”出现两个记事本的解决方法介绍了,其实两个记事本选项并不会影响用户的使用,可以不删除。更多精彩文章请持续关注WIN7之家http://www.xingexing.com。

我要分享:
上一篇:
下一篇:


本站发布的ghost系统与电脑软件仅为个人学习测试使用,请在下载后24小时内删除,不得用于任何商业用途,否则后果自负,请支持购买微软正版软件!

如侵犯到您的权益,请及时通知我们,我们会及时处理。

Copyright @ 2016 win7之家 网站导航网站地图