@ECHO OFF&(PUSHD "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(
powershell -Command "Start-Process '%~sdpnx0' -Verb RunAs"&&EXIT)

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

regsvr32 /s /u "%~dp09.12.12C\AliIMX.dll"
regsvr32 /s /u "%~dp09.12.12\AliIMX_64.dll"
regsvr32 /s /u "%~dp09.12.12C\AliIMSSOLogin.dll"

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

net stop wwbizsrv >NUL 2>NUL
sc delete wwbizsrv >NUL 2>NUL
IF NOT EXIST "%ProgramW6432%" (
if exist "%ProgramFiles%\Alibaba\wwbizsrv\wwbizsrv.exe" rd/s/q "%ProgramFiles%\Alibaba\wwbizsrv" 2>NUL
) ELSE (
if exist "%ProgramFiles(x86)%\Alibaba\wwbizsrv\wwbizsrv.exe" rd/s/q "%ProgramFiles(x86)%\Alibaba\wwbizsrv" 2>NUL
)
reg delete "HKLM\SYSTEM\CurrentControlSet\Services\wwbizsrv" /f >NUL 2>NUL

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

ver|findstr "5\.[0-9]\.[0-9][0-9]*" >NUL && (
del/q "%UserProfile%\桌面\阿里旺旺.lnk" >NUL 2>NUL
del/q "%AllUsersProfile%\桌面\阿里旺旺.lnk" >NUL 2>NUL
rd/s/q "%UserProfile%\「开始」菜单\程序\阿里旺旺"2>NUL
rd/s/q "%AllUsersProfile%\「开始」菜单\程序\阿里旺旺"2>NUL )
ver|findstr "\<6\.[0-9]\.[0-9][0-9]*\> \<10\.[0-9]\.[0-9][0-9]*\>" >NUL && (
del/q "%Public%\Desktop\阿里旺旺.lnk" >NUL 2>NUL
del/q "%UserProfile%\Desktop\阿里旺旺.lnk" >NUL 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\阿里旺旺"2>NUL
rd/s/q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\阿里旺旺"2>NUL )

reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AliWangWang" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AliWangWang" /f /reg:32 >NUL 2>NUL

CLS
ECHO.&ECHO 423down.com
ECHO.&ECHO 清除完成，确认删除？
ECHO.&ECHO 1、删除软件保留当前用户数据
ECHO.&ECHO 2、删除软件以及当前用户数据
CHOICE /C 12 /N >NUL 2>NUL

IF "%ERRORLEVEL%"=="2" (
  PUSHD .. & RD /S/Q "%~DP0" >NUL 2>NUL)
  
IF "%ERRORLEVEL%"=="1" (
  IF EXIST "profiles" (
    FOR /F "delims=*" %%a IN ('dir /a/b *.*^|findstr /v /i "profiles$"') DO (
    RD /S/Q "%%a" >NUL 2>NUL & DEL /F/Q "%%a" >NUL 2>NUL)
    ) ELSE (
    PUSHD .. & RD /S/Q "%~DP0" >NUL 2>NUL))