Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Do not have access to hosts file


15 Apr 2012   #1

64 bit home premium
 
 
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 System SpecsSystem Spec
.

15 Apr 2012   #2

Win7 Ultimate x64 SP1 / WCP x64 / Ubuntu 11 x64
 
 

Have you run Notepad as Administrator?
My System SpecsSystem Spec
15 Apr 2012   #3

Windows 8.1 Pro x64
 
 

Use the MS Fixit tool to resolve the issue
How can I reset the Hosts file back to the default?
My System SpecsSystem Spec
.


15 Apr 2012   #4

64 bit home premium
 
 

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 System SpecsSystem Spec
15 Apr 2012   #5

Win7 Ultimate x64 SP1 / WCP x64 / Ubuntu 11 x64
 
 

Quote   Quote: Originally Posted by envz28 View Post
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 System SpecsSystem Spec
15 Apr 2012   #6

Windows 8.1 Pro RTM x64
 
 

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 System SpecsSystem Spec
15 Apr 2012   #7

64 bit home premium
 
 

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 System SpecsSystem Spec
15 Apr 2012   #8

64 bit home premium
 
 

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 System SpecsSystem Spec
Reply

 Do not have access to hosts file




Thread Tools



Similar help and support threads for2: Do not have access to hosts file
Thread Forum
Hosts File General Discussion
Solved Hosts: always Access Denied or asking for Admin permissions General Discussion
Solved Hosts file-S?? System Security
HOSTS File - Create a "Edit HOSTS file" Shortcut Tutorials
HOSTS file Network & Sharing

Our Sites

Site Links

About Us

Find 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 01:59 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33