Follow these troubleshooting steps in order to resolve the error and successfully flash your device. 1. Change the Flashing Script Selection
This error is more common than you think, but the solution is rarely explained clearly. In this long-form guide, we will break down why this error happens, what the missing file actually does, and step-by-step methods to resolve the “Mi Flash error cannot find file flashalllockbat” forever.
To avoid any further errors during the flashing process, double-check these settings before clicking "Flash":
Windows sometimes struggles with deep folder hierarchies, spaces in folder names, or special characters.
cannot find file flashall_lock.bat
instead if you do not strictly need to relock your bootloader. Re-download the Fastboot ROM
Switch the selection from to Clean all (or Clean all except storage if you want to keep your data). Click Refresh , and then click Flash again.