@echo off
setlocal

set AppKey={C8A7314B-B4E4-45F5-AF10-3ACDF7F8B5B1}_is1

for %%K in ("HKEY_LOCAL_MACHINE" "HKEY_CURRENT_USER") do (
    reg query "%%K\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%AppKey%" /v UninstallString >nul 2>&1
    if not errorlevel 1 (
        for /f "tokens=2*" %%A in (
            'reg query "%%K\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%AppKey%" /v UninstallString ^| find "UninstallString"'
        ) do (
            set UninstallPath=%%B
        )
        goto found
    )
)

for %%K in ("HKEY_LOCAL_MACHINE" "HKEY_CURRENT_USER") do (
    reg query "%%K\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\%AppKey%" /v UninstallString >nul 2>&1
    if not errorlevel 1 (
        for /f "tokens=2*" %%A in (
            'reg query "%%K\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\%AppKey%" /v UninstallString ^| find "UninstallString"'
        ) do (
            set UninstallPath=%%B
        )
        goto found
    )
)

echo cannot find uninstall path in registry key，please check if the program is installed
pause
exit /b

:found
echo find uninstall path：%UninstallPath%

set UninstallPath=%UninstallPath:"=%
"%UninstallPath%" /VERYSILENT /SUPPRESSMSGBOXES /NORESTART
echo uninstalling ...
exit /b