To fix the error, diagnose the root cause first. The issue usually falls into one of four categories:
Ensure your device has at least 50% charge, even though EDL mode draws power from the USB. If you'd like to troubleshoot further, tell me: What phone model are you trying to flash? Which Windows version are you using? qfil failed to open com port handle
“Failed to open COM port handle.”