@echo off &setlocal EnableExtensions &color 03

::::::::::::::::  UNINSTALL  ::::::::::::::::

mode con cols=40 lines=10

::vars
set appname=avs to x264
set "curdir=%~dp0"
set "curdir=%curdir:~0,-1%"
set "utils_path=%curdir%\utils"
set "dll32=%utils_path%\KuShellExtension\KuShell.dll"
set "dll64=%utils_path%\KuShellExtension\KuShell64.dll"

title %appname% - Desinstallation

::unreg dll
if /i "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
	regsvr32 /s /u "%dll64%"
) else if /i "%PROCESSOR_ARCHITEW6432%"=="AMD64" (
	regsvr32 /s /u "%dll64%"
)
regsvr32 /s /u "%dll32%"

:: environment variables
set regenv_path=HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
set reg_shutdown=avstox264_shutdown
set reg_delbat=avstox264_delbat
for %%a in ("%reg_shutdown%" "%reg_delbat%") do (
	>nul reg delete "%regenv_path%" /v "%%~a" /f 2>&1
)

::message
cls
echo.&echo.
echo   %appname% a ‚t‚ desinstall‚.
echo   il est pr‚f‚rable de rebooter le PC.
echo.&echo.
echo   Appuyez sur une touche pour quitter.
pause>nul
goto:eof