Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Hosts file editing: save problem

11 Dec 2011   #1
rundwald

Home Premium 64 bit
 
 
Hosts file editing: save problem

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?




Attached Images
 
My System SpecsSystem Spec
.
11 Dec 2011   #2
Ztruker

Windows 10 Pro X64
 
 

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 System SpecsSystem Spec
12 Dec 2011   #3
rundwald

Home Premium 64 bit
 
 

Thanks! It worked, but I wish I understood the commands.
My System SpecsSystem Spec
.

13 Dec 2011   #4
Ztruker

Windows 10 Pro X64
 
 

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 System SpecsSystem Spec
Reply

 Hosts file editing: save problem




Thread Tools




Similar help and support threads
Thread Forum
Hosts file ignored and replaced with hosts.original
Hello. I am trying to use the hosts file. However both pings and web addresses still bypass the hosts file. I noticed that there is another file in the C:\Windows\System32\drivers\etc directory called 'hosts.original'. When ever I delete this file, it reappears seconds later. I have made sure that...
General Discussion
editing hosts file
I am trying to modify the hosts file so that it will block certain websites. I tried the following code, but it does not seem to do anything when i visit the website (as in, the page loads normally): 127.0.0.1 asite.com what am i doing wrong? i made sure i saved before viewing the website.
General Discussion
problem hosts file
Hello, I am hosting a weberver on a windows 7 pc. It's ip address: 192.168.0.100 Mijn domainname is: (example) www.mysite.nl If i type from another pc on my local network in the url of the browser: www.mysite.nl, he can not find the indexpage of the webserver I have to type my local...
Network & Sharing
Hosts File Editing
I've tried everything I've read on this forum to be able to edit my hosts file. I log on as administrator, I open my editor as administrator, I take ownership of the hosts file, but I still get the error:- "Save Failed. Please check whether if this file is opened in another program." What...
Network & Sharing
BSOD after editing hosts file and running warcraft 3?
Hello, this is my second BSOD so far. i had one analysed months back, and this is my second. this is what i got after restarting my laptop: Problem signature: Problem Event Name: BlueScreen OS Version: 6.1.7600.2.0.0.768.3 Locale ID: 18441 Additional information about the...
BSOD Help and Support


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 00:28.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App