Advertisement
Najeebsk

Website Block Script.bat

Apr 16th, 2024
720
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.58 KB | None | 0 0
  1. @echo off
  2. setlocal
  3.  
  4. rem Define the local IP address to which Google domains will be redirected
  5. set local_ip=127.0.0.1
  6.  
  7. rem List of Google domains to block
  8. set domains=www.google.com google.com www.google.co.in google.co.in
  9.  
  10. rem Location of the hosts file
  11. set hosts_file=%SystemRoot%\System32\drivers\etc\hosts
  12.  
  13. rem Add entries to the hosts file to block Google domains
  14. echo Blocking Google domains...
  15. for %%d in (%domains%) do (
  16.     echo %local_ip% %%d >> %hosts_file%
  17. )
  18.  
  19. rem Flush DNS cache to apply changes
  20. ipconfig /flushdns
  21.  
  22. echo Google has been blocked.
  23.  
  24. endlocal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement