@echo off
:: Restarting the driver by hardware ID
:: We use it for the crutch method via DSE-Patcher [Does not work in 24H2 windows 11 at the moment]

:: We check whether the script is running from the administrator
net session >nul 2>&1
if %errorlevel% == 0 (
    echo Already running with administrator rights.
) else (
    echo Administrator rights are required. Restarting it...
    powershell -Command "Start-Process '%~f0' -Verb RunAs"
    exit /b
)

:: Use "pnputil /enum-devices /class Media" and enter your already installed drivers with error 52
pnputil /restart-device "BTHENUM\{0000110b-0000-1000-8000-00805f9b34fb}_VID&000105d6_PID&000a\7&24dc049d&0&C4CBBE1430D7_C00000000"
echo Driver №1 has been restarted.
pnputil /restart-device "BTHENUM\{0000110b-0000-1000-8000-00805f9b34fb}_VID&000105ac_PID&0220\7&24dc049d&0&4142269D4643_C00000000"
echo Driver №2 has been restarted.

echo The drivers have been restarted!

exit