@ECHO OFF&(CD /D "%~DP0")&(REG QUERY "HKU\S-1-5-19">NUL 2>&1)||(powershell -Command "Start-Process '%~snx0' -Verb RunAs"&&exit)
taskkill /f /im Format* /t >NUL 2>NUL
taskkill /f /im ffmpeg.exe >NUL 2>NUL
taskkill /f /im QRecord.exe >NUL 2>NUL
regsvr32 /s /u ShellEx_108.dll
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\FormatPlayer" /f >NUL 2>NUL
reg delete "HKCU\Software\FreeTime\FormatFactory" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\CLSID\{A3888923-CFD3-4A6B-89BF-08E6B95716E8}" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\*\shellex\ContextMenuHandlers\FormatFactoryShell" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\Directory\shellex\ContextMenuHandlers\FormatFactoryShell" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\FormatFactory.exe" /F >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.264" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.265" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.3g2" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.3gp" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.amv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.asf" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.avi" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.avs" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.bik" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.cpk" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.dat" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.dav" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.dif" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.dv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.dvr-ms" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.f4v" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.fli" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.flv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.gif" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.h264" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.h265" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.ifv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.m2t" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.m2ts" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.m3u8" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.m4v" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.mkv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.mod" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.mov" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.mp4" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.mpeg" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.mpg" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.mts" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.ogg" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.ogm" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.ogv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.qsv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.qt" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.rm" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.rmvb" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.trp" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.ts" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.vfw" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.vob" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.webm" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.wmv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.x264" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.x265" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.xv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\Classes\FormatPlayer.yuv" /f >NUL 2>NUL
reg delete "HKLM\SOFTWARE\RegisteredApplications" /f /v "FormatPlayer" >NUL 2>NUL
for /f "skip=2 tokens=3 delims= " %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v personal') do (
for /f "delims=*" %%j in ('echo %%i') do rd /s /q "%%j\FormatFactory" 2>NUL)

Call :_RestartExplorer
goto :eof
:_RestartExplorer
(
  echo Dim arrURL^(^), strURL, oShell, oWin, n
  echo n = -1
  echo Set oShell = CreateObject^("Shell.Application"^)
  echo For Each oWin In oShell.Windows
  echo   If Instr^(1, oWin.FullName, "\explorer.exe", vbTextCompare^) Then
  echo     n = n + 1
  echo     ReDim Preserve arrURL^(n^)
  echo     arrURL^(n^) = oWin.LocationURL
  echo   End If
  echo Next
  echo CreateObject^("WScript.Shell"^).run "tskill explorer", 0, True
  echo For Each strURL In arrURL
  echo   oShell.Explore strURL
  echo Next
)>"%temp%\RestartExplorer.vbs"
  CScript //NoLogo "%temp%\RestartExplorer.vbs"
  del "%temp%\RestartExplorer.vbs" >NUL 2>NUL & cd .. & rd/s/q "%~dp0"2>NUL
  goto :eof
EXIT