@echo off
:: ================================================
:: EnableiGPUPassthrough.bat
:: Purpose: Fully enable AMD iGPU passthrough devices
:: and automatically activate all greyed/degraded
:: subordinate Bluetooth/MEDIA devices.
:: Usage: Schedule at logon via Task Scheduler
:: ================================================
echo Enabling GPU Display Adapter...
pnputil /enable-device "PCI\VEN_1002&DEV_13C0&SUBSYS_B0211F4C&REV_D8\4&23f93f77&0&00E0"
echo Enabling GPU HDMI Audio...
pnputil /enable-device "HDAUDIO\FUNC_01&VEN_1002&DEV_AA01&SUBSYS_00AA0100&REV_1008\5&36250e79&0&0001"
echo Enabling Bluetooth Root Adapter...
pnputil /enable-device "USB\VID_13D3&PID_3604&MI_00\8&13c9d4d2&0&0000"
:: Wait for child devices to enumerate (30 seconds is reliable, not heavy)
::echo Waiting 30 seconds for child devices to enumerate...
::timeout /t 30 >nul
:: Auto-enable greyed/degraded Bluetooth subordinates
echo Enabling greyed Bluetooth devices...
powershell -Command "Get-PnpDevice -Class 'Bluetooth' | Where-Object {$_.Status -in 'Error','Degraded','Unknown'} | Enable-PnpDevice -Confirm:$false"
:: Auto-enable greyed/degraded MEDIA subordinates
echo Enabling greyed MEDIA devices...
powershell -Command "Get-PnpDevice -Class 'MEDIA' | Where-Object {$_.Status -in 'Error','Degraded','Unknown'} | Enable-PnpDevice -Confirm:$false"
:: Restart Bluetooth service to finalize everything
echo Restarting Bluetooth service...
net stop bthserv
net start bthserv
echo All passthrough devices enabled and activated.