@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 DTLite* >NUL 2>NUL
taskkill /f /im DiscSo* >NUL 2>NUL
taskkill /f /im DTLauncher* >NUL 2>NUL

start /wait /B "" "%~dp0DiscSoftBusServiceLite.exe" /unmountall
::start /wait /B "" "%~dp0DiscSoftBusServiceLite.exe" /uninstalldriver
start /wait /B "" "%~dp0DiscSoftBusServiceLite.exe" /unregserver

rd/s/q "%APPDATA%\DAEMON Tools Lite"2>NUL
reg delete "HKCU\Software\Disc Soft" /F>NUL 2>NUL
reg delete "HKCU\Software\DAEMON.Tools.Lite" /F>NUL 2>NUL
reg delete "HKLM\Software\Disc Soft\DAEMON Tools Lite" /F>NUL 2>NUL
if exist "%Public%" rd/s/q "%ProgramData%\DAEMON Tools Lite" 2>NUL
if not exist "%Public%" rd/s/q "%AllUsersProfile%\Application Data\DAEMON Tools Lite" 2>NUL
CLS & ECHO.&ECHO 卸载完成！按任意键退出！&PAUSE >NUL 2>NUL & EXIT