无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 182|回复: 12
打印 上一主题 下一主题

调用记事本不能打开编辑Hosts

[复制链接]
跳转到指定楼层
1#
发表于 3 小时前 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
各位大佬,notepad.exe调用打开编辑hosts命令突然失效了,不知命令哪里不对,麻烦大佬更改




reg add "HKCR\DesktopBackground\shell\Item0\shell\OpenMoreRegedit" /f /v "MUIVerb" /t REG_SZ /d "编辑 Hosts"
reg add "HKCR\DesktopBackground\shell\Item0\shell\OpenMoreRegedit" /f /v "Icon" /t REG_SZ /d "C:\Windows\System32\mshta.exe,0"
reg add "HKCR\DesktopBackground\shell\Item0\shell\OpenMoreRegedit\command" /f /ve /t REG_SZ /d "mshta vbscript:createobject(\"shell.application\").shellexecute(\"notepad.exe\",\"C:\Windows\system32\drivers\etc\hosts\",\"\",\"runas\",1)(close)"

2#
发表于 3 小时前 | 只看该作者
本帖最后由 518hl 于 2025-12-27 19:07 编辑

@echo off
echo 正在修复hosts文件编辑器...
reg delete "HKCR\DesktopBackground\shell\Item0\shell\OpenMoreRegedit" /f
reg add "HKCR\DesktopBackground\shell\OpenHosts" /f /ve /t REG_SZ /d "编辑 Hosts"
reg add "HKCR\DesktopBackground\shell\OpenHosts" /f /v "Icon" /t REG_SZ /d "C:\Windows\System32\mshta.exe,0"
reg add "HKCR\DesktopBackground\shell\OpenHosts\command" /f /ve /t REG_SZ /d "notepad.exe \"C:\Windows\system32\drivers\etc\hosts\""
echo 修复完成!右键桌面空白处选择“编辑 Hosts”即可打开hosts文件。
pause


ai回答的 好像不行

点评

不行  详情 回复 发表于 3 小时前
回复

使用道具 举报

3#
 楼主| 发表于 3 小时前 | 只看该作者
518hl 发表于 2025-12-27 19:05
@echo off
echo 正在修复hosts文件编辑器...
reg delete "HKCR\DesktopBackground\shell\Item0\shell\Ope ...

不行
回复

使用道具 举报

4#
发表于 3 小时前 | 只看该作者
拷贝未被损坏的记事本程序替换试试

点评

记事本正常工作没损坏  详情 回复 发表于 3 小时前
回复

使用道具 举报

5#
 楼主| 发表于 3 小时前 | 只看该作者
a66 发表于 2025-12-27 19:17
拷贝未被损坏的记事本程序替换试试

记事本正常工作没损坏
回复

使用道具 举报

6#
发表于 3 小时前 | 只看该作者
感谢分享
回复

使用道具 举报

7#
发表于 2 小时前 | 只看该作者
查系统版本?
回复

使用道具 举报

8#
发表于 2 小时前 | 只看该作者
reg add "HKCR\DesktopBackground\shell\OpenMoreRegedit" /f /ve /t REG_EXPAND_SZ /d "编辑 Hosts"
reg add "HKCR\DesktopBackground\shell\OpenMoreRegedit" /f /v "Icon" /t REG_EXPAND_SZ /d "C:\Windows\System32\mshta.exe,1"
reg add "HKCR\DesktopBackground\shell\OpenMoreRegedit\command" /f /ve /t REG_EXPAND_SZ /d "%SystemRoot%\system32\mshta.exe vbscript:createobject(\"shell.application\").shellexecute(\"%SystemRoot%\system32\notepad.exe\",\"C:\Windows\system32\drivers\etc\hosts\",\"\",\"runas\",1)(close)"

点评

OK!!!!!  发表于 1 小时前
回复

使用道具 举报

9#
发表于 半小时前 | 只看该作者
不能打开编辑——————有没有什么提示?
回复

使用道具 举报

10#
发表于 19 分钟前 | 只看该作者
学习一下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-12-27 22:30

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表