Geeks I need a batch script to add some hosts to Windows 10 hosts file. I tried running the script in administrator mode and also clearing the read only flag from the hosts file but I get access denied error. Please help. Thanks in advance
There is no need to write a .bat for what you want to accomplish I have used HostsMan for many years and also Hostserver to take care of my Hosts file, Just make sure you disable DNS Client in services.msc before you try to go to any web page or your page loads will be either slower than molasses in a artic winter or not load at all. If your really hell bent on using a .bat file check these site's out https://github.com/crazy-max/WindowsSpyBlocker https://github.com/StevenBlack/hosts https://github.com/jakeogh/dnsgate http://someonewhocares.org/hosts/ http://winaero.com/blog/stop-windows-10-spying-on-you-using-just-windows-firewall/ Edit: You may want to stay away from HpHosts because they are very aggressive in what they chose to block. It's easy to unblock stuff but many people cant be bothered adding an exception to the rules and then resetting their cash to load a page that they Ham-fistedly blocked. they also block Yahoo and many other sites that people actually use and need on a daily basis Edit: 2 I posted a link to Ham-fistedly blocked on TenForums and it got promptly deleted. I also posted on Ham-fistedly blocked telling MysteryFCM that TenForums deleted my post, Looking at HpHosts forums I see he deleted my post there, I wonder if MDL will delete this post LOL
hosts commander works well in batch files Just take care if running on x64 system (as it best to place it in syswow64 folder)
Just one more tool to the list: Blue Life Hosts Editor http://www.sordum.org/8266/bluelifehosts-editor-v1-2/ cheers
Check this site out, everything you never wanted to know about the windows host file : http://winhelp2002.mvps.org/hosts.htm
Sorry for the late reply friends. Finally I found out the solution. It's just converting the batch file to exe and the voila the entries are there in the host file. I know that it can be done with a hosts editor but I wanted to do it with a single click. Anyway thank you very much.