Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. @echo off
  2. if "%1"=="list" (
  3. netsh advfirewall firewall show rule Blockit | findstr RemoteIP
  4. exit/b
  5. )
  6.  
  7. :: Deleting existing block on ips
  8. netsh advfirewall firewall delete rule name="Blockit"
  9.  
  10. :: Block new ips (while reading them from blockit.txt)
  11. for /f %%i in (blockit.txt) do (
  12. netsh advfirewall firewall add rule name="Blockit" protocol=any dir=in action=block remoteip=%%i
  13. netsh advfirewall firewall add rule name="Blockit" protocol=any dir=out action=block remoteip=%%i
  14. )
  15.  
  16. :: call this batch again with list to show the blocked IPs
  17. call %0 list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement