上下文菜单中缺少“创建新文本文档”选项

上下文菜单中缺少“创建新文本文档”选项

我今天注意到,当我右键单击时,Windows 7 (x64 Ultimate) 上下文菜单中不再有“创建新文本文档”选项。不知道它是如何或何时消失的,重点是它已经消失了。

在 Google 上搜索有同样问题的人后,我尝试关注了本指南

.txt但我马上就卡住了,因为我在注册表中没有看到任何键HKEY_CLASSES_ROOT。我只看到一个.text,但我不确定这是否是同一件事。

答案1

我获得了另一台运行 Windows 7 的 PC 的访问权限,这台电脑的上下文菜单完好无损。我查看了这台机器的注册表,并准确复制了输入的内容。这样做解决了桌面上上下文菜单损坏的问题。

按照上面列出的所有说明,.txt我需要的键内的两个字符串是Content TypePerceivedType

总结一下,如果你也遇到了类似的问题,以下是我解决这个问题的方法。希望对你也有用。

(首先备份注册表。)

  1. 打开regedit.exe
  2. 展开HKEY_CLASSES_ROOT并查找.txt密钥。如果不存在,则创建一个。
  3. .txt键内,创建两个新的字符串:Content TypePerceivedType
  4. (右键点击)调整...并且 的值Default应该是txtfile
  5. (右键点击)调整...并且 的值Content Type应该是text/plain
  6. (右键点击)调整...并且 的值PerceivedType应该是text
  7. ShellNew使用该密钥内的名称创建一个新密钥.txt
  8. ShellNew键内,创建一个名为 的新字符串NullFile
  9. 在密钥内ShellNew,创建一个新的可扩展字符串值名称为ItemName
  10. (右键点击)调整...并且的值ItemName应该是@%SystemRoot%\system32\notepad.exe,-470

以下是最终结果的两张截图:

在此处输入图片描述

在此处输入图片描述

答案2

创建一个带有扩展名的新文件.reg,复制、粘贴、保存并运行。

Windows Registry Editor Version 5.00

; clear the key
[-HKEY_CLASSES_ROOT\.txt]

; and recreate
[HKEY_CLASSES_ROOT\.txt]
"PerceivedType"="text"
@="txtfile"
"Content Type"="text/plain"

[HKEY_CLASSES_ROOT\.txt\ShellNew]
; @C:\Windows\system32\notepad.exe,-470
"ItemName"=hex(2):40,00,43,00,3a,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,00,\
  73,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6e,00,6f,\
  00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,2c,00,2d,00,34,00,\
  37,00,30,00,00,00
"NullFile"=""

答案3

Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\.txt]

[HKEY_CLASSES_ROOT\.txt]
"PerceivedType"="text"
@="txtfile"
"Content Type"="text/plain"

[HKEY_CLASSES_ROOT\.txt\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"

[HKEY_CLASSES_ROOT\.txt\ShellNew]
"ItemName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,\
  6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,\
  00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,2c,00,\
  2d,00,34,00,37,00,30,00,00,00
"NullFile"=""

[-HKEY_CLASSES_ROOT\txtfile]

[HKEY_CLASSES_ROOT\txtfile]
"EditFlags"=dword:00010000
@="Text Document"
"FriendlyTypeName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,\
  00,6f,00,6f,00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,\
  32,00,5c,00,6e,00,6f,00,74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,\
  00,2c,00,2d,00,34,00,36,00,39,00,00,00

[HKEY_CLASSES_ROOT\txtfile\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,69,00,6d,00,\
  61,00,67,00,65,00,72,00,65,00,73,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,31,\
  00,30,00,32,00,00,00

[HKEY_CLASSES_ROOT\txtfile\shell]

[HKEY_CLASSES_ROOT\txtfile\shell\open]

[HKEY_CLASSES_ROOT\txtfile\shell\open\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
  54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,25,00,31,00,00,\
  00

[HKEY_CLASSES_ROOT\txtfile\shell\print]

[HKEY_CLASSES_ROOT\txtfile\shell\print\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
  54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,2f,00,70,00,20,\
  00,25,00,31,00,00,00

[HKEY_CLASSES_ROOT\txtfile\shell\printto]

[HKEY_CLASSES_ROOT\txtfile\shell\printto\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6e,00,6f,00,\
  74,00,65,00,70,00,61,00,64,00,2e,00,65,00,78,00,65,00,20,00,2f,00,70,00,74,\
  00,20,00,22,00,25,00,31,00,22,00,20,00,22,00,25,00,32,00,22,00,20,00,22,00,\
  25,00,33,00,22,00,20,00,22,00,25,00,34,00,22,00,00,00

[-HKEY_CLASSES_ROOT\SystemFileAssociations\.txt]

[HKEY_CLASSES_ROOT\SystemFileAssociations\.txt]
"PerceivedType"="document"

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt]

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\OpenWithList]
"a"="NOTEPAD.EXE"
"MRUList"="a"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.txt\OpenWithProgids]
"txtfile"=hex(0):

答案4

只需自行添加.txt 键,然后确保存在以下字符串值:

HKEY_CLASSES_ROOT\.txt\ShellNew\NullFile

shell 将使用它来决定将哪些项目放在‘新建’菜单上。

在此处输入图片描述

微软在这里有一篇关于此问题的知识库文章: http://support.microsoft.com/kb/140333

如果您要添加一个全新的类型(或修复损坏的类型),则可能需要添加另一个条目来指定使用的文本。HKCR.txt 的默认条目应该是“txtfile”。然后确保您有一个 HKCR\txtfile 条目,其默认条目类似于“文本文档”:

在此处输入图片描述

关闭 Explorer 的所有实例(最好重新启动),这样就应该可以了。

相关内容