@ECHO OFF
PUSHD %~DP0
If "%PROCESSOR_ARCHITECTURE%"=="AMD64" (Set a=%SystemRoot%\SysWOW64) Else (Set b=%SystemRoot%\system32)
Md "%b%\test_permissions" 2>nul||(Echo 请使用右键管理员身份运行&&Pause >nul&&Exit)
Rd "%b%\test_permissions"
SetLocal EnableDelayedExpansion
taskkill /f /im IDM* >NUL 2>NUL
taskkill /f /im IEMon* >NUL 2>NUL
Net Stop IDMWFP >NUL 2>NUL
Regsvr32 /s /u IDMIECC64.dll
Regsvr32 /s /u IDMIECC.dll
Regsvr32 /s /u IDMGetAll64.dll
Regsvr32 /s /u IDMGetAll.dll
Regsvr32 /s /u downlWithIDM64.dll
Regsvr32 /s /u downlWithIDM.dll
Regsvr32 /s /u IDMNetMon64.dll
Regsvr32 /s /u IDMNetMon.dll
Rundll32 setupapi.dll,InstallHinfSection DefaultUninstall 128 .\idmwfp.inf
Regsvr32 /s /u IDMShellExt64.dll
Regsvr32 /s /u IDMShellExt.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 "HKLM\SOFTWARE\Internet Download Manager" /F>NUL 2>NUL
reg delete "HKLM\SOFTWARE\Wow6432Node\Internet Download Manager" /F>NUL 2>NUL
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