@echo *********************************************************************
@echo This tool is used to clean up the Digital USB driver completely!
@echo Version 01.00.00.000
@echo *********************************************************************
@echo   *
@echo   *

	@echo on
	@echo "Start to clean up Digital USB Driver "
	@echo off

	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_02" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_02" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_02" a.txt>>b.txt		
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_8765&pid_1234" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_8765&pid_1234" a.txt>>b.txt		
	for /f "delims=#" %%a in (b.txt) do echo %%a [7]>>c.txt
	regini c.txt
	del /q a.txt
	del /q b.txt
	del /q c.txt
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\vid_8765&pid_1234" /f

	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_02" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_02" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_02" a.txt>>b.txt		
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_8765&pid_1234" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_8765&pid_1234" a.txt>>b.txt		
	for /f "delims=#" %%a in (b.txt) do echo %%a [7]>>c.txt
	regini c.txt
	del /q a.txt
	del /q b.txt
	del /q c.txt
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a11&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a21&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a31&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\vid_8765&pid_1234" /f

	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a11 0a21 0a31)
	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a11 0a21 0a31)
	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a11 0a21 0a31)
	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet004\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a11 0a21 0a31)
	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a11 0a21 0a31)
	del /q a.txt

	del /q %windir%\system32\driver\HyteraComposite.sys
	del /q %windir%\system32\driver\HyteraUSBDriver.sys
	del /q %windir%\system32\driver\rndismpy.sys
	del /q %windir%\system32\driver\usb8023y.sys
	del /q %windir%\system32\driver\USBBulk.sys
	
	for /l %%a in ( 0, 1, 100) do (findstr /i "Hytera" %windir%\inf\oem%%a.inf 
					if %ERRORLEVEL%==0 del /q %windir%\inf\oem%%a.*)
	
	devcon remove "USB\VID_FEDC&PID_7FFB&MI_00"
	devcon remove "USB\VID_FEDC&PID_7FFA&MI_00"
	devcon remove "USB\VID_238B&PID_0A*1&MI_00"
	devcon remove "USB\VID_FEDC&PID_7FFB&MI_02"
	devcon remove "USB\VID_FEDC&PID_7FFA&MI_02"
	devcon remove "USB\VID_238B&PID_0A*1&MI_02"
	devcon remove "USB\VID_FEDC&PID_7FFB"
	devcon remove "USB\VID_FEDC&PID_7FFA"
	devcon remove "USB\VID_238B&PID_0A*1"
	devcon remove "USB\VID_8765&PID_1234"
	devcon remove "USB\VID_238B&PID_0A*2"

	taskkill /IM device_detector.exe /F
	taskkill /IM rundll32.exe /FI "MODULES eq newdev.dll" /F
	DPInst32.EXE /Q /u usbbulk.inf
	DPInst32.EXE /Q /u radio_rndis.inf
	DPInst32.EXE /Q /u radiousbdriver.inf
	DPInst32.EXE /Q /u radiocomposite.inf

	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_02" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_02" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_02" a.txt>>b.txt		
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_8765&pid_1234" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_8765&pid_1234" a.txt>>b.txt		
	for /f "delims=#" %%a in (b.txt) do echo %%a [7]>>c.txt
	regini c.txt
	del a.txt
	del b.txt
	del c.txt
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB\vid_8765&pid_1234" /f

	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_02" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_02" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_00" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_00" a.txt>>b.txt
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_02" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_02" a.txt>>b.txt		
	reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_8765&pid_1234" /s>a.txt
	findstr /i "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_8765&pid_1234" a.txt>>b.txt		
	for /f "delims=#" %%a in (b.txt) do echo %%a [7]>>c.txt
	regini c.txt
	del /q a.txt
	del /q b.txt
	del /q c.txt
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a12&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a22&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_00" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\Vid_238b&Pid_0a32&MI_02" /f
	reg delete "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Hardware Profiles\Current\System\CurrentControlSet\Enum\USB\vid_8765&pid_1234" /f

	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a12 0a22 0a32)
	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a12 0a22 0a32)
	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet003\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a12 0a22 0a32)
	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\ControlSet004\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a12 0a22 0a32)
	for /l %%a in ( 0, 1, 100 ) do (call :delete_reg %%a HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{36FC9E60-C465-11CF-8056-444553540000} 0a12 0a22 0a32)
	del /q a.txt
	
	exit

:delete_reg
set count=000%1
if %1 GTR 9 set count=00%1
reg query "%2\%count%" /s>a.txt
if %ERRORLEVEL%==1 goto :end_delete_reg
findstr /i "vid_8765&pid_1234" a.txt
if %ERRORLEVEL%==0 reg delete "%2\%count%" /f
findstr /i "vid_238b&pid_%3" a.txt
if %ERRORLEVEL%==0 reg delete "%2\%count%" /f
findstr /i "vid_238b&pid_%4" a.txt
if %ERRORLEVEL%==0 reg delete "%2\%count%" /f
findstr /i "vid_238b&pid_%5" a.txt
if %ERRORLEVEL%==0 reg delete "%2\%count%" /f
:end_delete_reg


