RegisterServer.bat 693 B

12345678910111213141516171819202122
  1. rem %1 = udp server port
  2. rem %2 = http server port
  3. rem %3 = https server port
  4. if [%1]==[] GOTO DONE
  5. netsh advfirewall firewall delete rule name="Port %1" protocol=UDP localport=%1
  6. netsh advfirewall firewall add rule name="Port %1" dir=in action=allow protocol=UDP localport=%1
  7. if [%2]==[] GOTO DONE
  8. netsh advfirewall firewall delete rule name="Port %2" protocol=TCP localport=%2
  9. netsh advfirewall firewall add rule name="Port %2" dir=in action=allow protocol=TCP localport=%2
  10. if [%3]==[] GOTO DONE
  11. netsh advfirewall firewall delete rule name="Port %3" protocol=TCP localport=%3
  12. netsh advfirewall firewall add rule name="Port %3" dir=in action=allow protocol=TCP localport=%3
  13. :DONE
  14. Exit