allow_port.bat 1.9 KB

1234567891011121314151617181920212223242526272829303132333435
  1. @echo off
  2. ::netsh advfirewall firewall add rule name="exename" dir=in action=allow program="程序路径" enable=yes
  3. ::netsh advfirewall firewall add rule name="yuanchengu" dir=in protocol=udp localport=3390-3391 action=allow
  4. netsh advfirewall firewall delete rule name="远程TCP" dir=in
  5. netsh advfirewall firewall add rule name="远程TCP" dir=in protocol=tcp localport=3389-3390 action=allow
  6. netsh advfirewall firewall delete rule name="远程UCP" dir=in
  7. netsh advfirewall firewall add rule name="远程UCP" dir=in protocol=udp localport=3389-3390 action=allow
  8. netsh advfirewall firewall delete rule name="DEVICETCP" dir=in
  9. netsh advfirewall firewall add rule name="DEVICETCP" dir=in protocol=tcp localport=51609 action=allow
  10. netsh advfirewall firewall delete rule name="DEVICEUDP" dir=in
  11. netsh advfirewall firewall add rule name="DEVICEUDP" dir=in protocol=udp localport=51609 action=allow
  12. netsh advfirewall firewall delete rule name="WebSocket" dir=in
  13. netsh advfirewall firewall add rule name="WebSocket" dir=in protocol=tcp localport=10086 action=allow
  14. netsh advfirewall firewall delete rule name="Web" dir=in
  15. netsh advfirewall firewall add rule name="Web" dir=in protocol=tcp localport=21006 action=allow
  16. netsh advfirewall firewall delete rule name="NewWeb" dir=in
  17. netsh advfirewall firewall add rule name="NewWeb" dir=in protocol=tcp localport=21008 action=allow
  18. ::netsh advfirewall firewall delete rule name="http" dir=in
  19. ::netsh advfirewall firewall add rule name="http" dir=in protocol=tcp localport=10088 action=allow
  20. ::netsh advfirewall firewall delete rule name="21009" dir=in
  21. ::netsh advfirewall firewall add rule name="21009" dir=in protocol=tcp localport=21009 action=allow
  22. netsh advfirewall firewall delete rule name="10089" dir=in
  23. netsh advfirewall firewall add rule name="10089" dir=in protocol=udp localport=10089 action=allow
  24. ::pause