@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

net stop pcas >NUL 2>NUL 
"%AppData%\\alipay\cf\alicsrv.exe" /R >NUL 2>NUL
"%AppData%\alipay\cf\alicnotify.exe" /R >NUL 2>NUL
"%AppData%\alipay\cf\aliccom.exe" /R >NUL 2>NUL
"%AppData%\AppData\Roaming\alipay\cf\alicupsrv.exe" /R >NUL 2>NUL
regsvr32 /s "%AppData%\AppData\Roaming\alipay\cf\alicdo.dll" >NUL 2>NUL
regsvr32 /s "%AppData%\AppData\Roaming\alipay\cf\alicdo_x64.dll" >NUL 2>NUL

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

start /wait /B "" "%~dp0AliIM.exe" /removetask
start /wait /B "" "%~dp0AliIM.exe" /cleansdk /nouaccheck
start /wait /B "" "%~dp0AliIM.exe" /addfw
start /wait /B "" "%~dp09.11.02C\EndProcess.exe"  IMClient-RV
:: start /wait /B "" "%~dp0wwbizsrv.exe" /install
:: start /wait /B "" "%~dp0wwbizsrv.exe" /install /path:"%~dp0"

ECHO.&ECHO 绿化完成！创建快捷方式？
ECHO.&ECHO 是按任意键，否直接关闭！&PAUSE >NUL 2>NUL

mshta VBScript:Execute("Set a=CreateObject(""WScript.Shell""):Set b=a.CreateShortcut(a.SpecialFolders(""Desktop"") & ""\阿里旺旺.lnk""):b.TargetPath=""%~dp0AliIM.exe"":b.WorkingDirectory=""%~dp0"":b.Save:close")

CLS &ECHO.&ECHO 创建完成！&PAUSE >NUL 2>NUL & EXIT