REM Ultimate RLM floating license server Uninstaller
REM Developed by Ahad Mohebbi
@echo Off
cls
echo    Uninstalling the RLM License Server in Microsoft Windows   
echo ===============================================================
echo.
REM stop RLM_License_Server...
net stop RLM_License_Server

REM delete RLM_License_Server
sc delete RLM_License_Server

REM remove license files...
rmdir /s /q "%ProgramFiles%"\rlm\


REM remove foundry license file...
if exist "%ProgramData%\The Foundry\RLM" rmdir /s /q "%ProgramData%\The Foundry\RLM"
if exist "%ProgramData%\The Foundry\FLEXlm" rmdir /s /q "%ProgramData%\The Foundry\FLEXlm"
if exist "%ProgramData%\The Foundry\RLM\log" rmdir /s /q "%ProgramData%\The Foundry\RLM\log"
if exist "%ProgramData%\The Foundry\FLEXlm\log" rmdir /s /q "%ProgramData%\The Foundry\FLEXlm\log"
echo.

REM remove peregrineLabs Licens files...
if exist "%ProgramData%\PeregrineLabs/rlm/" rmdir /s /q "%ProgramData%\PeregrineLabs/rlm/"
echo.

REM remove genarts license fils...
if exist "%ProgramData%\GenArts\rlm" rmdir /s /q "%ProgramData%\GenArts\rlm"

REM delete license environment from registery
echo.
REG delete HKCU\Environment /F /V fabricinc_LICENSE
REG delete HKCU\Environment /F /V foundry_LICENSE
REG delete HKCU\Environment /F /V genarts_LICENSE
REG delete HKCU\Environment /F /V golaem_LICENSE
REG delete HKCU\Environment /F /V innobright_LICENSE
REG delete HKCU\Environment /F /V mootzoid_LICENSE
REG delete HKCU\Environment /F /V nextlimit_LICENSE
REG delete HKCU\Environment /F /V peregrinel_LICENSE
REG delete HKCU\Environment /F /V redshift_LICENSE
REG delete HKCU\Environment /F /V solidangle_LICENSE
REG delete HKCU\Environment /F /V SFX_LICENSE_SERVER
REG delete HKCU\Environment /F /V RLM_LICENSE

echo.
echo The RLM License Server successfully removed.
CD %HOMEPATH%
