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才能執行
Brad Chen's Developer Blog Azure Database Data science Machine Learning Cloud
訂閱:
張貼留言 (Atom)
-
SQL Server Enterprise 與 Standard 基本差異比較如下 : SQL Server Enterprise Edition SQL Server Standard Edition ...
-
a bicycle manufacturer - Adventure Works Cycles Scenarios include Manufacturing , Sales , Purchasing , Product Management , Contact Manageme...
-
Oracle version support matrix Oracle Release 19 Oracle Database Client Software Requirements https://docs.oracle.com/en/database/oracle/orac...
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就可以了
張貼留言