Can't Edit hosts file in Windows 10

Hello,

I was trying to add a line in hosts file to adjust a domain name with wamp server but it doesn't allow me to, I get access denied and another error: The process cannot access the file because it is being used by another process...

I tried many ways through this link http://windowsreport.com/access-denied-hosts-windows-10/

But still doesn't work. I have Avira Antivirus and ZoneAlarm firewall all disabled and still something is missing
thebest8Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

max_the_kingCommented:
Hi,
right click on "../etc" folder where the hosts file reside

add permission in properties/security for your account: give full control.

It will work ...

hope this helps
max
0
Radhakrishnan RSenior Technical LeadCommented:
Hi,

Make sure that you have full control of the file/folder (or administrators group and you are member of that group). The second error you mentioned looks like some of the services still using the file. I.e - "DNS client", "TCP/IP NetBIOS Helper" services etc.
0
McKnifeCommented:
Before editing, start notepad elevated: right click notepad.exe and select "run as administrator" - now it will work.
1
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

JohnBusiness Consultant (Owner)Commented:
Open Notepad using Run as Administrator. Navigate to the HOSTS file, open it, edit it and save it.

I do this instead of giving full control to the HOSTS folder.  Providing full control to this folder (target for viruses) reduces security.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Abhi PappiTechnical Lead - Network SupportCommented:
Hi,

Open a command prompt with "run as administrator", and run the command

notepad c:\windows\system32\drivers\etc\hosts

Is it opening?

Thanks,
0
arnoldCommented:
To add to what was already said since Windows 7 even administrators starting programs, those program run with limited rights unless run as administrator was used to start them, as covered by the experts earlier. With that said, notepad is not UAC aware or uac notifications are disabled. In either case when one tries to save and elevation is needed, the user will not be prompted.
Using netepad+ or othe similar text editor...

In the absence, I be would save as in another location, and then use file explorer to copy the modified hosts file to the c:\windows\system32\drivers\etc
0
thebest8Author Commented:
Still didn't fix it, I have attached several screenshot for you to check, it doesn't work with Run as Administrator
cap1.JPG
cap2.JPG
cap3.JPG
cap4.JPG
Cap5.JPG
Cap6.JPG
0
arnoldCommented:
what are you running as administrator?
try the suggested solution, save a copy of the modified hosts file. then copy it using file explorer and once prompted provide admin credentials and you should be done.

What happens after you click the OK to elevate your rights in cat6.jpg?
0
JohnBusiness Consultant (Owner)Commented:
The attributes on the file are correct. Let's cover the instructions again.

Right Click on Notepad.exe and select Run as Administrator. Does this work?  Are you challenged for credentials?  if so, then authorize. Make this entire step is completed.

Now inside Notepad, navigate to HOSTS and open it. There is more than one HOSTS file - make sure you select the active one.

Now edit and save.
0
McKnifeCommented:
cap3.jpg shows, that some other process has locked this file (which is not normal). Do you have that hosts file open in anything else but notepad at the same time? If in doubt, logoff and on again and repeat what you just did.
0
thebest8Author Commented:
Ok I found the solution to it.

The issue is coming from ZoneAlarm and Avira Antivirus locking hosts file

check screenshot
cap7.JPG
cap8.JPG
0
JohnBusiness Consultant (Owner)Commented:
Avira has caused more than one problem in here. Safety by preventing people from working.
1
thebest8Author Commented:
thank you all
0
JohnBusiness Consultant (Owner)Commented:
You are very welcome and thank for your helpful update. I was happy to work with you on this.
1
thebest8Author Commented:
thank you Mr John
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 10

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.