@ECHO OFF & CD /D %~DP0 & TITLE
>NUL 2>&1 REG.exe query "HKU\S-1-5-19" || (
    ECHO SET UAC = CreateObject^("Shell.Application"^) > "%TEMP%\Getadmin.vbs"
    ECHO UAC.ShellExecute "%~f0", "%1", "", "runas", 1 >> "%TEMP%\Getadmin.vbs"
    "%TEMP%\Getadmin.vbs"
    DEL /f /q "%TEMP%\Getadmin.vbs" 2>NUL
    Exit /b
)

taskkill /f /im AliIM*  >NUL 2>NUL
taskkill /f /im aliedit.exe  >NUL 2>NUL
taskkill /f /im wwbizsrv.exe >NUL 2>NUL

start /wait /B "" "%~dp0AliIM.exe" /removetask
::start /wait /B "" "%~dp0wwbizsrv.exe" /Uninstall
::start /wait /B "" "%~dp0wwbizsrv.exe" /Uninstall /path:"%~dp0"

rd/s/q "%AppData%\AliWangWang" 2>NUL

reg delete "HKLM\Software\AliIM" /f >NUL 2>NUL
reg delete "HKLM\Software\WOW6432Node\AliIM" /f >NUL 2>NUL

del /q "%userprofile%\Desktop\阿里旺旺.lnk" >NUL  2>NUL 
del /q "%userprofile%\桌面\阿里旺旺.lnk" >NUL  2>NUL 

ECHO. &ECHO 卸载完成！&PAUSE >NUL 2>NUL & EXIT