@echo off
setlocal

echo,
echo [~] Administrative permissions required. Detecting permissions...
echo,
net session >nul 2>&1
if %errorLevel% == 0 (
    echo   [+] Success: Administrative permissions confirmed.
    echo,
    ) else (
        echo     [-] Failure: Current permissions inadequate. Re-run this batch file by right clicking on it and selecting "Run as administrator"
	echo,
	pause
	exit
    )



echo This deletes registry keys from ThunderCloud Windows Universal. If Hub Pro is currently installed, remove and reinstall Hub Pro after running this script 
timeout 1 > nul
echo: 
echo Checking for current keys (Errors or 0 matches is acceptable)
timeout 3 > nul

reg query HKEY_CLASSES_ROOT\Extensions\ContractId\Windows.Protocol\PackageId /s /f xosdigital.xosthunderclouduniversal /k
reg query HKEY_CLASSES_ROOT\thundercloud\ /s /f shell /k

echo: 
echo Press enter to confirm delete
pause > nul
echo: 
reg delete HKEY_CLASSES_ROOT\Extensions\ContractId\Windows.Protocol\PackageId\XOSDigital.XOSThunderCloudUniversal_24.1.1.0_x64__zjx4nymqqgxd2 /f
reg delete HKEY_CLASSES_ROOT\thundercloud\ /f
echo: 
timeout 2 > nul
echo Confirming keys deleted:
timeout 2 > nul

echo: 
reg query HKEY_CLASSES_ROOT\Extensions\ContractId\Windows.Protocol\PackageId /s /f xosdigital.xosthunderclouduniversal /k
reg query HKEY_CLASSES_ROOT\thundercloud\ /s /f shell /k
echo: 
echo If this returns any matches, contact Catapult Support
echo: 
echo Press enter to close
pause > nul