Skip to content

Instantly share code, notes, and snippets.

@shahidcodes
Created April 30, 2019 11:16
Show Gist options
  • Save shahidcodes/1aac9e029e6ca9de187a8960525f67bb to your computer and use it in GitHub Desktop.
Save shahidcodes/1aac9e029e6ca9de187a8960525f67bb to your computer and use it in GitHub Desktop.
windows 10 hidden host (marked as system file) fixed.txt
From a command prompt with administrative access type each of the following commands:
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /G BUILTIN\Users:R
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G "BUILTIN\Power Users:R"
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G BUILTIN\Administrators:F
CACLS.EXE C:\WINDOWS\system32\drivers\etc\hosts /E /G "NT AUTHORITY\SYSTEM:F"
ATTRIB.EXE -S -H +A -R C:\WINDOWS\system32\drivers\etc\hosts
If this doesn't resolve the issue you will need a better program to do it. Download SubInACL from Microsoft. You can work up the syntax for taking ownership or I'll do it if you can't figure it out.
It should be something like:
SubInACL.EXE /file C:\WINDOWS\system32\drivers\etc\hosts /setowner=%USERDOMAIN%\%USERNAME%
then rerun the commands above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment