2008年12月26日 星期五

Windows firewall Command Line 開例外清單Port

Windows firewall Command Line 開例外清單Port Range
[Single Port]
開8080/TCP Port

C:\netsh firewall add portopening TCP 8080 "HTTP Port8080"
C:\netsh firewall delete portopening TCP 8080

[Port Range]
為FTP passive mode開5500/TCP到5700/TCP Port

C:\FOR /L %I IN (5500,1,5700) DO netsh firewall add portopening TCP %I "FTP Passive mode Port Range"%I

C:\FOR /L %I IN (5500,1,5700) DO netsh firewall delete portopening TCP %I

PS.若要將以上command寫在batch file請將%I都改成%%I才能執行

2 則留言:

匿名 提到...

FOR /L %I IN (5500,1,5700) DO netsh firewall add portopening TCP %I "FTP Passive mode Port Range"%I

這句不能save 成BAT FILE

BAT 不能用FOR 嗎??

匿名 提到...

把%I都改成%%I就可以了

SQL Server Database Mirroring 資料庫鏡像

SQL Server Database Mirroring 資料庫鏡像