Share via

Accidentally saved hosts file as a txt

Anonymous
2014-09-10T12:00:03+00:00

Hey guys! So while I was editing my hosts file, I accidentally saved it as a .txt file from notepad. Is there anyway to change it back?

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2014-09-10T16:15:47+00:00

    Typically, I locate Notepad and right-click, Run as administrator when dealing with any of the files within the %SYSTEMDIR%\System32\Drivers\Etc folder but you are probably already aware of that.

    When saving your Hosts file from Notepad you need to change the Save as type: to All files (*.*) or Notepad will always try to tack on a .TXT extension.

    If you want to try to rename from an elevated command prompt, click Start or tap the Windows key and type cmd then hit Ctrl+Shift+Enter all together. Acknowledge the UAC warning and provide credentials if asked. With the elevated command prompt window open you can issue the following command,

    copy C:\Windows\System32\Drivers\Etc\Hosts.txt Hosts

    That should make a copy of your Hosts file without the .TXT extension. You can keep the one with the .TXT extension as a backup or delete it.

    20+ people found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful