Unable to save changes to Hosts file
Description
Cause
User Account Control (UAC) enabled
Resolution
[BCB:4:Operating system warning:ECB]

Section I: Run Notepad as administrator

  1. Go to Start, Windows Accessories, Notepad or Start, All Programs, Accessories
  2. Right-click Notepad and select Run as administrator and confirm any prompts
  3. In Notepad, select File, Open
  4. Browse to C:\Windows\system32\drivers\etc
  5. Select All Files (*.*) from the drop-down list at the bottom of the window
  6. Select Hosts file and click Open
  7. Make changes to the Hosts files, and verify you can save

Section II: Change ownership

  1. Right-click Hosts and select Properties
  2. Select Security tab
  3. Click Advanced
  4. Select Owner tab
  5. Click Edit
  6. Select the currently logged-in user from the Change owner to list; if not listed:
    1. Click Other users or groups
    2. Type the user name in the Enter the object name to select field
    3. Click OK
  7. Click OK
  8. Click OK on the changing ownership message
  9. Click OK on the Advanced Security Settings window
  10. Click OK on the Properties window
  11. Open Hosts, make the changes, and save; if you cannot save, proceed to next Section

Section III: Force rename

  1. Open Hosts, make the changes, and save as a .txt file
  2. Move Hosts to the desktop
  3. Press Windows+R keys
  4. Type cmd and click OK
  5. Type cd\ and press Enter
  6. Type cd\windows\system32\drivers\etc and press Enter
  7. Type ren Hosts.txt Hosts and press Enter
  8. Close the command prompt window
  9. Verify Hosts is present in the etc folder, and contains the changes you made
  10. Delete Hosts copy on the Desktop
DocLink: How to modify the Hosts file
Defect ID
Steps to duplicate
Related Articles