@ECHO OFF&PUSHD %~DP0 &TITLE 卸载
Rd "%WinDir%\system32\test_permissions" >NUL 2>NUL
Md "%WinDir%\System32\test_permissions" 2>NUL||(Echo 请使用右键管理员身份运行！&&Pause >nul&&Exit)
Rd "%WinDir%\System32\test_permissions" 2>NUL
SetLocal EnableDelayedExpansion

taskkill /f /im IDM* >NUL 2>NUL
taskkill /f /im IEMon* >NUL 2>NUL

If Exist "%Public%" Net Stop IDMWFP >NUL 2>NUL
If Not Exist "%Public%" Net Stop IDMTDI >NUL 2>NUL

If Exist "%Public%" Rundll32 setupapi.dll,InstallHinfSection DefaultUninstall 128 .\idmwfp.inf
If Not Exist "%Public%" Rundll32 setupapi.dll,InstallHinfSection DefaultUninstall 128 .\idmtdi.inf

If Exist "%WinDir%\SysWOW64" Regsvr32 /s /u IDMShellExt64.dll

rd/s/q "%AppData%\IDM"2>NUL
If Exist "%a%" rd/s/q "%ProgramData%\IDM" 2>NUL
rd/s/q "%AllUsersProfile%\Application Data\IDM"2>NUL
reg delete HKCU\Software\DownloadManager /v scansk /f>NUL 2>NUL
reg delete HKCU\Software\DownloadManager /v tvfrdt /f>NUL 2>NUL
reg delete HKCU\Software\DownloadManager /v CheckUpdtVM /f>NUL 2>NUL
reg delete HKCU\Software\DownloadManager /v LName /f>NUL 2>NUL
reg delete HKCU\Software\DownloadManager /v FName /f>NUL 2>NUL
reg delete HKCU\Software\DownloadManager /v Email /f>NUL 2>NUL
reg delete HKCU\Software\DownloadManager /v Serial /f>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Internet Download Manager" /f>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Wow6432Node\Internet Download Manager" /f>NUL 2>NUL
reg delete HKCU\Software\Classes\CLSID\{07999AC3-058B-40BF-984F-69EB1E554CA7} /f>NUL 2>NUL
reg delete HKCU\Software\Classes\CLSID\{6DDF00DB-1234-46EC-8356-27E7B2051192} /f>NUL 2>NUL
reg delete HKCU\Software\Classes\CLSID\{D5B91409-A8CA-4973-9A0B-59F713D25671} /f>NUL 2>NUL
reg delete HKCU\Software\Classes\CLSID\{7B8E9164-324D-4A2E-A46D-0165FB2000EC} /f>NUL 2>NUL
reg delete HKCU\Software\Classes\CLSID\{5ED60779-4DE2-4E07-B862-974CA4FF2E9C} /f>NUL 2>NUL
reg delete HKLM\Software\Classes\CLSID\{07999AC3-058B-40BF-984F-69EB1E554CA7} /f>NUL 2>NUL
reg delete HKLM\Software\Classes\CLSID\{6DDF00DB-1234-46EC-8356-27E7B2051192} /f>NUL 2>NUL
reg delete HKLM\Software\Classes\CLSID\{D5B91409-A8CA-4973-9A0B-59F713D25671} /f>NUL 2>NUL
reg delete HKLM\Software\Classes\CLSID\{7B8E9164-324D-4A2E-A46D-0165FB2000EC} /f>NUL 2>NUL
reg delete HKLM\Software\Classes\CLSID\{5ED60779-4DE2-4E07-B862-974CA4FF2E9C} /f>NUL 2>NUL
reg delete HKCU\Software\Classes\Wow6432Node\CLSID\{7B8E9164-324D-4A2E-A46D-0165FB2000EC} /f>NUL 2>NUL
reg delete HKCU\Software\Classes\Wow6432Node\CLSID\{5ED60779-4DE2-4E07-B862-974CA4FF2E9C} /f>NUL 2>NUL
reg delete HKLM\Software\Classes\Wow6432Node\CLSID\{7B8E9164-324D-4A2E-A46D-0165FB2000EC} /f>NUL 2>NUL
reg delete HKLM\Software\Classes\Wow6432Node\CLSID\{5ED60779-4DE2-4E07-B862-974CA4FF2E9C} /f>NUL 2>NUL
taskkill /f /im explorer.exe >NUL 2>NUL & start explorer
ECHO.&ECHO.完成! 是否需要备份个人设置？
ECHO.&ECHO.是请按任意键，否直接关闭吧！&PAUSE >NUL 2>NUL
regedit /e "用户配置.reg" HKEY_CURRENT_USER\Software\DownloadManager >NUL 2>NUL
reg delete HKEY_CURRENT_USER\Software\DownloadManager /f>NUL 2>NUL

ECHO.&ECHO.完成! &PAUSE >NUL 2>NUL