Do not have access to hosts file


  1. Posts : 4
    64 bit home premium
       #1

    Do not have access to hosts file


    Hi all,

    I've been trying to battle a little problem for quite some time now.

    My hosts file has been encrypted with some different IP addresses which inevitably redirect me to some websites.

    I have tried to open my hosts file through notepad as administrator, then take out the bad IP addresses and when I try to save I get access denied.

    The hosts file itself is set to read only and I do not have "access" to change it.

    My user account is the sole account on this PC and is infact the administrator.

    tldr:

    -Note pad administrator won't work with changing hosts file
    -hosts file won't let me change securities parameters

    I'm begging for help! I've spent several hours trying to find a guide and every single one says to use Notepad in administrator but that just isn't working for me

    Edit-All these attempts have been in safemode with networking
      My Computer


  2. Posts : 499
    Win7 Ultimate x64 SP1 / WCP x64 / Ubuntu 11 x64
       #2

    Have you run Notepad as Administrator?
      My Computer


  3. Posts : 8,383
    Windows 10 Pro x64, Arch Linux
       #3

    Use the MS Fixit tool to resolve the issue
    How can I reset the Hosts file back to the default?
      My Computer


  4. Posts : 4
    64 bit home premium
    Thread Starter
       #4

    Influx~ I said several times that I ran notepad as administrator

    Yowanvista~

    I tried running the tool and that did not solve the problem. The hosts file is still set to read only and I do not have access to change it.

    I tried the manual method and it won't let me save the original file as hosts.old

    Nor when i right click within the etc file does new give me an option to make a text document.

    I'm open to more ideas!
      My Computer


  5. Posts : 499
    Win7 Ultimate x64 SP1 / WCP x64 / Ubuntu 11 x64
       #5

    envz28 said:
    Influx~ I said several times that I ran notepad as administrator
    Follow the complete instructions here on taking ownership with a file/folder. Windows 7 Take Ownership & Grant Permissions to Access Files & Folder
      My Computer


  6. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #6

    The following lines of code have been posted numerous times, but it is a useful batch file to have in your tool kit. It flushes the DNS cache and resets Microsoft's Host File.

    @Echo on
    pushd\windows\system32\drivers\etc

    attrib -h -s -r hosts
    echo 127.0.0.1 localhost>HOSTS
    attrib +r +h +s hosts
    popd
    ipconfig /release
    ipconfig /renew
    ipconfig /flushdns
    netsh winsock reset all
    netsh int ip reset all
    shutdown -r -t 1
    del %0

    Copy and paste the above in to Notepad and save it as Flush.bat to the desktop. Close all running applications and then right-click on the file and choose to run as an administrator, providing the necessary credentials when prompted. Your computer will automatically restart itself.
      My Computer


  7. Posts : 4
    64 bit home premium
    Thread Starter
       #7

    Dwarf~ I did your steps, not 100% what the object of that was. However it still did not fix the problem. From reading that command it looked like a reset of the hosts file but yeah still didn't work

    Influx~ I am following the steps but am stuck at a part in which I tried way before hand and it still will not work

    *On step 5 in "How to Grant Permission in Windows 7"

    When trying to change the permission settings to Full Control I am unable to check the box.

    UPDATE:

    *my etc folder had the owner set to TrustedInstaller. I then changed the owner of the file to Ben *i.e. my account*

    I was then allowed to check the "Full Control" setting, however when I tried to apply the change I was given:

    Error Applying Security

    An error occured while applying security information to:

    C:\Windows\System32\drivers\etc\protocol

    Access is denied

    More help needed!

    *Side note, this sucks lol*
      My Computer


  8. Posts : 4
    64 bit home premium
    Thread Starter
       #8

    So i got the bright idea to go to the root:

    I went to my C: and right clicked and changed the security level there to allow me Full Access and I did this to every file up to etc. I successfully was able to change the hosts file to allow me Full Control.

    As of right now my hosts file is clear of all those pesky advertising IP addresses.

    I appreciate all your help. Your suggestions sort of led me onto the track. I will update if things go haywire

    Thanks so much!

    Env
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:50.
Find Us