A simple script that installs an ad-blocking extension from the web to the Windows hosts file.
The hosts file can be found at C:\Windows\System32\Drivers\etc\hosts.
- Stored at
%AppData%\hosts-adblocker\hosts-adblocker.ini. - Options:
hostsFileLength- Length of hosts file before modification. Setting this incorrectly may lead to omission of custom blocking rules.blocklistURL- URL of file to append to the hosts file. Make sure you trust this URL!
- Stored at
%AppData%\hosts-adblocker\hosts.bak.<timestamp>. - A new backup is created every time this script modifies the hosts file in any way.
/S- Run script in silent mode; suppresses reboot prompt upon success- Does not suppress error messages
/P- Purges all backup files- Moves files to Recycle Bin; does not permanently delete them
/U- Uninstalls blocklist from hosts file/?- Displays the help dialog