Solved Hosts file editing: save problem

rundwald

New member
Member
VIP
Local time
10:33 PM
Messages
394
Location
UK, Hampshire
My Hosts file was lost so I downloaded a new one. This I edited to block two sites that had intruded and given trouble. I saved initially to desktop and then tried to paste and save it in to C:\windows\.......\etc , but failed to do so as error as per att, appeared,

I am a sole user/ administrator, and also have opened run Notepad as administrator to no avail.

What am I doing wrong?
 

Attachments

  • error rehosts.png
    error rehosts.png
    14.3 KB · Views: 932
Last edited:

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell Inspiron 560MT
OS
Home Premium 64 bit
CPU
2.9 gigahertz Intel Core2 Duo 64 kilobyte primary memory cac
Motherboard
Board: Dell Inc. 0K83V0 A00 Serial Number: ..CN750939CP069B
Memory
4096 Megabytes Usable Installed Memory Slot 'DIMM0' has 102
Graphics Card(s)
ATI Radeon HD 4300/4500 Series
Sound Card
High Definition Audio Device NVIDIA High Definition Audio (
Monitor(s) Displays
DELL ST2210 [Monitor] (21.7"vis, s/n P479R01Q0VCU, January 2
Screen Resolution
1920x1080
Hard Drives
628.58 Gigabytes Usable Hard Drive Capacity
554.78 Gigabytes Hard Drive Free Space
Keyboard
Std Dell UK
Mouse
KEYBOARD, 105, UNITED KINGDOM, KWE9C0
Internet Speed
~8000 kbps
Antivirus
Avast Free
Browser
Chrome
Other Info
Office 2007: Photo Editing; Serif PhotoPlus X7
Open an Elevated Command prompt and do the following:

cd \windows\system32\drivers\etc
attrib -h -s -r hosts

Copy the new hosts file to this directory

attrib +r +h +s hosts

exit

That should do it.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Thanks!:thumbsup: It worked, but I wish I understood the commands.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell Inspiron 560MT
OS
Home Premium 64 bit
CPU
2.9 gigahertz Intel Core2 Duo 64 kilobyte primary memory cac
Motherboard
Board: Dell Inc. 0K83V0 A00 Serial Number: ..CN750939CP069B
Memory
4096 Megabytes Usable Installed Memory Slot 'DIMM0' has 102
Graphics Card(s)
ATI Radeon HD 4300/4500 Series
Sound Card
High Definition Audio Device NVIDIA High Definition Audio (
Monitor(s) Displays
DELL ST2210 [Monitor] (21.7"vis, s/n P479R01Q0VCU, January 2
Screen Resolution
1920x1080
Hard Drives
628.58 Gigabytes Usable Hard Drive Capacity
554.78 Gigabytes Hard Drive Free Space
Keyboard
Std Dell UK
Mouse
KEYBOARD, 105, UNITED KINGDOM, KWE9C0
Internet Speed
~8000 kbps
Antivirus
Avast Free
Browser
Chrome
Other Info
Office 2007: Photo Editing; Serif PhotoPlus X7
This one changes the current directory (the one you are in) to \windows\system32\drivers\etc. That's where the hosts file is located.

cd \windows\system32\drivers\etc

This one clears the Hidden (h), System (s) and Read Only (r) attributes, making the file visible and changeable.

attrib -h -s -r hosts

This one turn on the Hidden (h), System (s) and Read Only (r) attributes again to protect the hosts file from being easily modified.

attrib +r +h +s hosts
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Lenovo IdeaCenter 450
OS
Windows 10 Pro X64
CPU
Intel Quad Core i7-4770 @ 3.4Ghz
Memory
16.0GB PC3-12800 DDR3 SDRAM 1600 MHz
Graphics Card(s)
Intel Integrated HD Graphics
Sound Card
Realtek HD Audio
Monitor(s) Displays
HP 22" LCD
Screen Resolution
1680 x 1050
Hard Drives
250GB Samsung EVO SATA-3 SSD
2TB Seagate ST2000DM001 SATA-2
1.5TB Seagate ST3150041AS SATA
Keyboard
Dell USB
Mouse
Lenovo USB
Internet Speed
Cable via Road Runner 3MB Upload, 30MB Download
Antivirus
Windows Defender, MBAM Pro, MBAE
Browser
Seamonkey
Other Info
UEFI/GPT
PLDS DVD-RW DH16AERSH
Back
Top