0

I am trying to add an entry to my Windows hosts file and I"m having issues. I have already gotten around the Admin permissions issue by opening Notepad as and administrator and then opening the file via Notepad. However, I'm getting a new warning saying that the file is in use by another program and therefore can't be modified.

How can I get around this and update my file?

NOTE: The exact wording of the message is:

The process cannot access the file because its being used by another process.

Not sure if this makes a difference but I do have XAMPP installed, but Apache and Mysql are not running.

EDIT: I have tried looking for the process which might be locking the hosts file with suggestions here Find out which process is locking a file or folder in Windows but it doesn't even list my file as being locked!

user1015214
  • 205
  • 1
  • 3
  • 10
  • See if this question helps : [Find out which process is locking a file or folder in Windows](https://superuser.com/questions/117902/find-out-which-process-is-locking-a-file-or-folder-in-windows) – lx07 Jan 16 '20 at 15:13
  • @Ix07 I don't know anything about Powershell, how exactly do I use that? I had already seen this article and tried the Resource Moniter, but couldn't find my hosts file. – user1015214 Jan 16 '20 at 15:18
  • Does this answer your question? [Find out which process is locking a file or folder in Windows](https://superuser.com/questions/117902/find-out-which-process-is-locking-a-file-or-folder-in-windows) – Ramhound Jan 16 '20 at 15:26
  • @user1015214 - There are other solutions that don't require PowerShell. Even the PowerShell solution does not require knowledge of PowerShell, the script was provided, in that particular answer. – Ramhound Jan 16 '20 at 15:29
  • @Ramhound Well, its odd. I tried out the Resource Moniter and put 'hosts' in the search and nothing came up.... When I tried Process Exploerer, all I got was svchost.exe, and sihost.exe. – user1015214 Jan 16 '20 at 16:22
  • It could be locked by an antivirus or other security program (which is done to prevent malware from changing the hosts file). – DavidPostill Jan 16 '20 at 19:56
  • @DavidPostill How would I figure out how to stop that? Just by brute force and turning everything off? – user1015214 Jan 16 '20 at 21:49

0 Answers0