@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 WSHelper* >NUL 2>NUL
taskkill /f /im PDFelement* >NUL 2>NUL

::清除万兴产品附加垃圾组件及开机启动项 WSHelper；
rd/s/q "%LocalAppData%\Wondershare\WSHelper" 2>NUL
rd/s/q "%AppData%\Wondershare\Wondershare Helper Compact" 2>NUL
IF NOT EXIST "%ProgramW6432%" (
rd/s/q "%CommonProgramFiles%\Wondershare\Wondershare Helper Compact"2>NUL
) ELSE (
rd/s/q "%CommonProgramW6432%\Wondershare\Wondershare Helper Compact"2>NUL
rd/s/q "%CommonProgramFiles(x86)%\Wondershare\Wondershare Helper Compact"2>NUL)
reg delete "HKCU\Software\Wondershare\Wondershare Helper Compact" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Wondershare\Wondershare Helper Compact" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\WOW6432Node\Wondershare\Wondershare Helper Compact" /f >NUL 2>NUL
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /f /v "Wondershare Studio" >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "Wondershare Helper Compact.exe" >NUL 2>NUL
reg delete "HKCU\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" /f /v "WSVCUUpdateHelper.exe" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "WSVCUUpdateHelper.exe" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /f /v "Wondershare Helper Compact.exe" >NUL 2>NUL
reg delete "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Run" /f /v "Wondershare Helper Compact.exe" >NUL 2>NUL

FileAssociation.exe /UnInstallFileUnAssociate >NUL 2>NUL
start /b /wait "" "%~dp0CreatorForPDFEditor\WSPrtSetup.exe" /dvrname "Wondershare PDFelement" /prtname "Wondershare PDFelement" /monname "Wondershare PDFelement Monitor" /monport "Wondershare PDFelement Port" /monfile "%~dp0CreatorForPDFEditor\WSPDFelementMonitor.dll" /u >NUL 2>NUL

attrib -r -a -s -h -x "%temp%\WhatsNewFile_万兴PDF专家.xml" >NUL 2>NUL
attrib -r -a -s -h -x "%temp%\FullUpdateConfig_万兴PDF专家.xml" >NUL 2>NUL
attrib -r -a -s -h -x "%temp%\PatchUpdateConfig_万兴PDF专家.xml" >NUL 2>NUL
rd/s/q "%temp%\WhatsNewFile_万兴PDF专家.xml"2>NUL
rd/s/q "%temp%\PatchUpdateConfig_万兴PDF专家.xml"2>NUL
rd/s/q "%temp%\FullUpdateConfig_万兴PDF专家.xml"2>NUL

del/q "%WinDir%\System32\WSPECRT.dll" >NUL 2>NUL
del/q "%WinDir%\System32\TWAINDSM.dll" >NUL 2>NUL
del/q "%WinDir%\System32\TWAINDSM32.msm" >NUL 2>NUL
del/q "%WinDir%\SysWOW64\WSPECRT.dll" >NUL 2>NUL
del/q "%WinDir%\SysWOW64\WSPECRT.dll" >NUL 2>NUL
del/q "%WinDir%\SysWOW64\WSPECRT.dll" >NUL 2>NUL
del/q "%WinDir%\System32\WSPDFelementMonitor.dll" >NUL 2>NUL
del/q "%WinDir%\SysWOW64\WSPDFelementMonitor.dll" >NUL 2>NUL
del/q "%WinDir%\System32\spool\drivers\w32x86\3\PDFCREAT.BPD" >NUL 2>NUL
del/q "%WinDir%\System32\spool\drivers\w32x86\3\PDFCREAT.PPD" >NUL 2>NUL
rd/s/q "%CommonProgramFiles%\Wondershare\PDFelement"2>NUL
rd/s/q "%CommonProgramFiles(x86)%\Wondershare\PDFelement"2>NUL
rd/s/q "%AppData%\Wondershare" 2>NUL
rd/s/q "%LOCALAPPDATA%\Wondershare"2>NUL
rd/s/q "%LOCALAPPDATA%\PDFelement 7"2>NUL
rd/s/q "%ProgramData%\PDFelement 7" 2>NUL
del /q "%Public%\Desktop\万兴PDF专家.lnk" >NUL 2>NUL
del /q "%UserProfile%\Desktop\万兴PDF专家.lnk" >NUL 2>NUL
rd/s/q "%AppData%\Microsoft\Windows\Start Menu\Programs\万兴PDF专家"2>NUL
rd/s/q "%ProgramData%\Microsoft\Windows\Start Menu\Programs\万兴PDF专家"2>NUL

reg delete "HKCR\wspe7" /f >NUL 2>NUL
reg delete "HKCR\.fdf\OpenWithList\PDFelement.exe" /f >NUL 2>NUL
reg delete "HKCR\.pdf\OpenWithList\PDFelement.exe" /f >NUL 2>NUL
reg delete "HKCR\Applications\PDFelement.exe" /f >NUL 2>NUL
reg delete "HKCR\WondersharePDF.Document7"  /f >NUL 2>NUL
reg delete "HKCR\CLSID\{7561CFCF-E2B1-478B-9595-2B029D2418E8}" /f >NUL 2>NUL
reg delete "HKCR\SystemFileAssociations\.pdf\Shell\WondersharePDFExpert" /f  >NUL 2>NUL

reg delete "HKLM\wspe7" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\PEPrinter" /f >NUL 2>NUL
reg delete "HKLM\Software\Wondershare\5239" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\WOW6432Node\PEPrinter" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Wondershare\PeShellExt" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Wondershare\Wondershare PDFelement 7" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723" /f >NUL 2>NUL
reg delete "HKLM\Software\Wow6432Node\Wondershare\Wondershare PDF Expert" /f  >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Wondershare\Wondershare PDFelement 6 pro" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Wondershare\Wondershare PDFelement 6 pro" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Wow6432Node\Wondershare\Wondershare PDF Expert" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Wow6432Node\Wondershare\Wondershare PDFelement 7" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\PEShellExt.PeContextMenuExtension" /f >NUL 2>NUL
reg delete "HKLM\Classes\*\shellex\ContextMenuHandlers\PeContextMenuExtension" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{098A124A-AA1C-38C8-A65E-D1199A14516A}" /f >NUL 2>NUL
reg delete "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.fdf"  /f >NUL 2>NUL
reg delete "HKLM\Software\Classes\WondersharePDF.Document7" /f >NUL 2>NUL
reg delete "HKLM\Software\Classes\SystemFileAssociations\.pdf\Shell\WondersharePDFExpert" /f >NUL 2>NUL
reg delete "HKLM\Software\Classes\SystemFileAssociations\.pdf\Shell\WondersharePDFExpertPrint" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\PDFelement" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PDFelement" /f >NUL 2>NUL

CLS&ECHO.&ECHO 清除完成，删除软件?[敲1]
CHOICE /C 1 /N >NUL 2>NUL
IF "%ERRORLEVEL%"=="1" PUSHD .. & RD /S/Q "%~DP0" 2>NUL