Add batch files to add and remove firewall rules

This commit is contained in:
Ryan Caezar Itang 2022-08-16 11:57:14 +08:00
parent 6000b85b1a
commit 65b557d003
No known key found for this signature in database
GPG Key ID: E7C6E0E004B3AED1
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,8 @@
@echo off
set RULE_NAME=Sunshine
set PROGRAM_BIN="%~dp0sunshine.exe"
rem Add the rule
netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=tcp program=%PROGRAM_BIN% enable=yes
netsh advfirewall firewall add rule name=%RULE_NAME% dir=in action=allow protocol=udp program=%PROGRAM_BIN% enable=yes

View File

@ -0,0 +1,6 @@
@echo off
set RULE_NAME=Sunshine
rem Delete the rule
netsh advfirewall firewall delete rule name=%RULE_NAME%