RegisterServer.bat 1013 B

1234567891011121314151617181920212223242526272829
  1. rem %1 = udp server port
  2. rem %2 = http server port
  3. rem %3 = https server port
  4. rem %4 = exe path
  5. if [%1]==[] GOTO DONE
  6. netsh advfirewall firewall delete rule name="Port %1" protocol=UDP localport=%1
  7. netsh advfirewall firewall add rule name="Port %1" dir=in action=allow protocol=UDP localport=%1
  8. if [%2]==[] GOTO DONE
  9. netsh advfirewall firewall delete rule name="Port %2" protocol=TCP localport=%2
  10. netsh advfirewall firewall add rule name="Port %2" dir=in action=allow protocol=TCP localport=%2
  11. if [%3]==[] GOTO DONE
  12. netsh advfirewall firewall delete rule name="Port %3" protocol=TCP localport=%3
  13. netsh advfirewall firewall add rule name="Port %3" dir=in action=allow protocol=TCP localport=%3
  14. if [%4]==[] GOTO DONE
  15. netsh advfirewall firewall delete rule name="Emby Server"
  16. netsh advfirewall firewall add rule name="Emby Server" dir=in action=allow protocol=TCP program=%4 enable=yes
  17. netsh advfirewall firewall add rule name="Emby Server" dir=in action=allow protocol=UDP program=%4 enable=yes
  18. :DONE
  19. Exit