无忧启动论坛

标题: 调用记事本不能打开编辑Hosts [打印本页]

作者: wenbieba    时间: 4 天前
标题: 调用记事本不能打开编辑Hosts
各位大佬,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)"


作者: 518hl    时间: 4 天前
本帖最后由 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回答的 好像不行

作者: wenbieba    时间: 4 天前
518hl 发表于 2025-12-27 19:05
@echo off
echo 正在修复hosts文件编辑器...
reg delete "HKCR\DesktopBackground\shell\Item0\shell\Ope ...

不行
作者: a66    时间: 4 天前
拷贝未被损坏的记事本程序替换试试
作者: wenbieba    时间: 4 天前
a66 发表于 2025-12-27 19:17
拷贝未被损坏的记事本程序替换试试

记事本正常工作没损坏
作者: win82    时间: 4 天前
感谢分享
作者: dayeye    时间: 4 天前
查系统版本?
作者: cutebe    时间: 4 天前
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)"

作者: yyz2191958    时间: 4 天前
不能打开编辑——————有没有什么提示?
作者: smile_z    时间: 4 天前
学习一下
作者: qq8899399    时间: 4 天前



第3方软件 就是了。多方便

作者: ebaqiang    时间: 3 天前
进来学习一下
作者: rongtian    时间: 3 天前
学习一下
作者: cc2025    时间: 3 天前

不能打开编辑——————有没有什么提示?
作者: 燕飞龙    时间: 3 天前

感谢分享
作者: guong    时间: 3 天前
来学习的
作者: dib    时间: 3 天前
系统精简坏了吗?
作者: tanglf    时间: 3 天前
其他工具试试
作者: handsome_xiang    时间: 3 天前
学习一下
作者: Flame1363    时间: 前天 20:56
学习一下




欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/) Powered by Discuz! X3.3