jacob
V2EX  ›  Windows

windows 下编辑 hosts 文件从来没有这么酸爽过

  •  
  •   jacob · May 22, 2015 · 3036 views
    This topic created in 4035 days ago, the information mentioned may be changed or developed.
    为了方便编辑hosts,特意安装了一个hostseditor,可是还是很不方便,批量修改添加很麻烦,直到这条命令出现


    doskey edithosts=subl C:\windows\system32\drivers\etc\hosts


    注:需给当前用户添加hosts编辑权限
    3 replies    2015-05-22 15:01:01 +08:00
    vmebeh
        1
    vmebeh  
       May 22, 2015   ❤️ 1
    不建议修改 hosts 的写权限,改了之后普通权限运行的程序都能改 hosts,也就是桌面放个指向 notepad \windows\system32\drivers\etc\hosts 的快捷方式就能改 hosts.


    Win键 -> 输入notepad -> Ctrl + Shift + Enter -> Alt + Y -> Ctrl + O -> 输入 \windows\system32\drivers\etc\hosts -> Enter

    输入路径那一步可能会不快,用得不多还能忍;用得多就在文档建个 host 的硬连接
    jacob
        2
    jacob  
    OP
       May 22, 2015
    @vmebeh ctrl-shift-enter什么意思?以管理员运行吗?

    问题是不改权限无法直接保存啊
    icyflash
        3
    icyflash  
       May 22, 2015   ❤️ 1
    @jacob ctrl-shift-enter就相当于右键-以管理员身份运行
    以管理员身份运行记事本后,可以编辑hosts并保存
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3325 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 11:31 · PVG 19:31 · LAX 04:31 · JFK 07:31
    ♥ Do have faith in what you're doing.