RegisterServer.bat 895 B

12345678910111213141516171819202122232425262728
  1. rem %1 = http server port
  2. rem %2 = http server url
  3. rem %3 = udp server port
  4. rem %4 = tcp server port (web socket)
  5. if [%1]==[] GOTO DONE
  6. netsh advfirewall firewall delete rule name="Port %1" protocol=TCP localport=%1
  7. netsh advfirewall firewall add rule name="Port %1" dir=in action=allow protocol=TCP localport=%1
  8. if [%2]==[] GOTO DONE
  9. netsh http del urlacl url="%2" user="NT AUTHORITY\Authenticated Users"
  10. netsh http add urlacl url="%2" user="NT AUTHORITY\Authenticated Users"
  11. if [%3]==[] GOTO DONE
  12. netsh advfirewall firewall delete rule name="Port %3" protocol=UDP localport=%3
  13. netsh advfirewall firewall add rule name="Port %3" dir=in action=allow protocol=UDP localport=%3
  14. if [%4]==[] GOTO DONE
  15. netsh advfirewall firewall delete rule name="Port %4" protocol=TCP localport=%4
  16. netsh advfirewall firewall add rule name="Port %4" dir=in action=allow protocol=TCP localport=%4
  17. :DONE
  18. Exit