@echo off pushd "%~dp0" logman stop usbdkm -ets >nul 2>&1 logman delete usbdkm -ets >nul 2>&1 logman create trace usbdkm -o usbdk.etl -ow -ets logman update usbdkm -p {88e1661f-48b6-410f-b096-ba84e9f0656f} 0x7fffffff 6 -ets echo Recording started. echo Reproduce the problem, then press ENTER pause > nul logman stop usbdkm -ets if exist usbdk.log call :rename if not exist "C:\Program Files\UsbDk Runtime Library\usbdk.pdb" goto :usetmf tracefmt.exe usbdk.etl -nosummary -pdb "C:\Program Files\UsbDk Runtime Library\usbdk.pdb" -o usbdk.log goto usedone :usetmf if not exist "C:\Program Files\UsbDk Runtime Library\usbdk.tmf" goto :usenone tracefmt.exe usbdk.etl -nosummary -p "C:\Program Files\UsbDk Runtime Library\usbdk.tmf" -o usbdk.log goto usedone :usenone echo No TMF or PDB found :usedone if exist usbdk.log call :rename popd goto :eof :rename set fnum=0 :nextnum set /A fnum=%fnum%+1 if exist usbdk-%fnum%.log goto nextnum echo next is %fnum% ren usbdk.log usbdk-%fnum%.log set fnum= goto :eof