@echo off
REM ##############################################
echo Deleting firewall rules (old names).
netsh advfirewall firewall delete rule name=NxCloud_53_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_80_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_443_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_19003_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_19004_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_UDP19004_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_19003_out > NUL
netsh advfirewall firewall delete rule name=NxCloud_19004_out > NUL
netsh advfirewall firewall delete rule name=NxCloud_UDP19004_out > NUL
REM ##############################################
echo Deleting firewall rules (new names).
netsh advfirewall firewall delete rule name=NxCloud_UDP_53_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_TCP_80_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_TCP_443_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_TCP_19003_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_TCP_19004_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_TCP_19003_out > NUL
netsh advfirewall firewall delete rule name=NxCloud_TCP_19004_out > NUL
netsh advfirewall firewall delete rule name=NxCloud_UDP_19004_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_UDP_19004_out > NUL
netsh advfirewall firewall delete rule name=NxCloud_UDP_67_in > NUL
netsh advfirewall firewall delete rule name=NxCloud_UDP_68_out > NUL
REM ##############################################
set BPATH=%~dp0
cd %BPATH%
cd ..
REM ##############################################
set /p APPNAME=<conf\appname
net stop %APPNAME%
nxwrapper.exe remove
cd bin