Skip to content

Instantly share code, notes, and snippets.

@Justsoos
Created February 26, 2018 09:56
Show Gist options
  • Save Justsoos/4205d3c3e18429e5c0678aeee3cb37ab to your computer and use it in GitHub Desktop.
Save Justsoos/4205d3c3e18429e5c0678aeee3cb37ab to your computer and use it in GitHub Desktop.
一、 禁止修改HOSTS文件:
attrib +r +a +s +h %windir%\system32\drivers\etc\hosts
echo y|cacls %windir%\system32\drivers\etc\hosts /g everyone:r
二、允许修改HOSTS文件:
echo y|cacls %windir%\system32\drivers\etc\hosts /g everyone:f
attrib -r -a -s -h %windir%\system32\drivers\etc\hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment