@echo off echo Registry Hack to detect Xiaomi devices in fastboot mode on AMD series processors. echo Make sure latest stable ADB and fastboot drivers are already installed. (Get it from here --^> https://bit.ly/3giKtZJ) echo Administravite Permissions required to modify registry! echo[ echo [PRESS ENTER TO START] pause >nul 2>&1 if [%1] == [--skip-backup] ( GOTO Add_reg ) else ( GOTO backup_hklm ) :Add_reg echo[ echo Applying Reg hacks... timeout 2 >nul 2>&1 reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "osvc" /t REG_BINARY /d "0000" /f >nul 2>&1 if %ERRORLEVEL% == 0 ( echo Sucessfully added 'osvc' Registry key! ) else ( echo Error occured while adding 'osvc' key! - Already present or Lack of permissions. ) reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipContainerIdQuery" /t REG_BINARY /d "01000000" /f >nul 2>&1 if %ERRORLEVEL% == 0 ( echo Sucessfully added 'SkipContainerIdQuery' Registry key! ) else ( echo Error occured while adding 'SkipContainerIdQuery' key! - Already present or Lack of permissions. ) reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\18D1D00D0100" /v "SkipBOSDescriptorQuery" /t REG_BINARY /d "01000000" /f >nul 2>&1 if %ERRORLEVEL% == 0 ( echo Sucessfully added 'SkipBOSDescriptorQuery' Registry key! ) else ( echo Error occured while adding 'SkipBOSDescriptorQuery' key! - Already present or Lack of permissions. ) pause >nul 2>&1 goto EOF :backup_hklm echo[ echo Backing up usbflags registry key... timeout 2 >nul 2>&1 del "%~dp0\usbflags_backup.reg" >nul 2>&1 reg export HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\ "%~dp0\usbflags_backup.reg" > nul if %errorlevel% == 0 ( goto Add_reg ) else ( echo Error occured during backing up registry keys! echo [Press Enter] to continue patching keys without backing up else close the terminal. pause >nul 2>&1 goto Add_reg ) :EOF echo[