This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
if "%1"=="list" ( | |
netsh advfirewall firewall show rule multiple_ip_to_fw_rule | findstr RemoteIP | |
exit/b | |
) | |
netsh advfirewall firewall delete rule name="multiple_ip_to_fw_rule" | |
for /f %%i in (C:\PATH_TO_TEXT_FILE_WITH_IP_ADDRESSES\multiple_ip_to_fw_rule.txt) do ( | |
netsh advfirewall firewall add rule name="multiple_ip_to_fw_rule" protocol=any dir=in action=block remoteip=%%i |