Link to home
Start Free TrialLog in
Avatar of PBIT
PBITFlag for United States of America

asked on

Can't edit hosts file in Windows Server 2012

When trying to edit the hosts file, I get a "The process cannot access the file because it is being used by another process."

I know the file is controlled by the SYSTEM.  I tried opening NotePad with administrator rights but that did not help. I am not logged in as the system, but as an administrator and have full control on the  C:\Windows\System32\drivers\etc folder.

How can I edit the hosts file?
SOLUTION
Avatar of Cliff Galiher
Cliff Galiher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You need administrator privileges. Vat art command prompt as administrator and then run the following:

Notepad c:\windows\system32\drivers\etc\hosts
Avatar of PBIT

ASKER

Already running notepad in admin mode.  That does not solve the problem.
Try in safe mode, and check if you can.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rakesh Kapoor
Rakesh Kapoor

Open Notepad by selection the option run as an administrator > click on File > select Open and then browse the path of host file i.e. c:\windows\system32\drivers\etc\hosts.

Make the changes and then save it. Hope it would fix the issue.
Avatar of PBIT

ASKER

Thanks, I will look into the virus scanner potential.