RegisterServer.bat 465 B

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