Add and Remove Hosts Entries

This is a quick script I’ve used to add and remove entries to the windows hosts file. It ignores commented lines (lines starting with a hash (#)), and it also doesn’t validate the format of the host or IP address so use with care!


cscript.exe hosts.vbs “Add” “” “example”
cscript.exe hosts.vbs “Remove” “”


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.