@echo off
if _%1_==_payload_  goto :payload

:getadmin
	echo %~nx0: elevating self
	set vbs=%temp%\getadmin.vbs
	echo Set UAC = CreateObject^("Shell.Application"^) >> "%vbs%"
	echo UAC.ShellExecute "%~s0", "payload %~sdp0 %*", "", "runas", 1 >> "%vbs%"
	"%temp%\getadmin.vbs"
	del "%temp%\getadmin.vbs"
goto :eof

:payload

::ENTER YOUR CODE BELOW::   

for /f "tokens=*" %%i in ('"netsh advfirewall firewall delete rule name="Sentinel Port 1947""') do set delete=%%i
echo Trying to delete obsolete rules if existing ... %delete%
echo ---
echo Trying to add rules for incoming traffic at port 1947:
for /f "tokens=*" %%i in ('"netsh advfirewall firewall add rule name="Sentinel Port 1947" dir=in localport=1947 action=allow protocol=TCP"') do set tcpin=%%i
echo TCP ... %tcpin%
for /f "tokens=*" %%i in ('"netsh advfirewall firewall add rule name="Sentinel Port 1947" dir=in localport=1947 action=allow protocol=UDP"') do set udpin=%%i
echo UDP ... %udpin%
echo ---
echo Trying to add rules for outgoing traffic at port 1947:
for /f "tokens=*" %%i in ('"netsh advfirewall firewall add rule name="Sentinel Port 1947" dir=out localport=1947 action=allow protocol=TCP"') do set tcpout=%%i
echo TCP ... %tcpout%
for /f "tokens=*" %%i in ('"netsh advfirewall firewall add rule name="Sentinel Port 1947" dir=out localport=1947 action=allow protocol=UDP"') do set udpout=%%i
echo UDP ... %udpout%

::END OF YOUR CODE::

echo ---
echo Script completed...