Ensure you have a backup of your important data before proceeding. The author and this article are not responsible for any damage to your device.
Using flash_all.bat or any “flash all bat xiaomi link” involves risks:
Copy your extracted ROM files into your ADB/Platform Tools folder (typically in Open a command prompt in that folder, type flash_all.bat , and press Comparison of Script Options Effect on Device Bootloader Status flash_all.bat Wipes all data and flashes system Stays Unlocked flash_all_except_storage.bat Flashes system, keeps internal storage Stays Unlocked flash_all_lock.bat Wipes all data and flashes system Relocks Bootloader : Ensure your device's Bootloader is unlocked flash all bat xiaomi link
After the first extraction, you will get a .tar file. Extract this file a .
Flashing stock firmware on a Xiaomi, Redmi, or POCO device is the ultimate way to rescue a bootlooped phone, upgrade software manually, or revert from a custom ROM back to MIUI/HyperOS. Ensure you have a backup of your important
Add :: at the beginning of each line to comment them out. Save the file and rerun MiFlash.
: At the bottom of the tool, select clean all . Extract this file a
This means you need an to use EDL mode — a privilege typically reserved for official service centers and authorized repair shops. Xiaomi implemented this restriction to combat unauthorized resellers installing modified ROMs on imported devices.
You will see the command prompt come to life with lines of code, showing each partition as it is being flashed.
For Linux users, the equivalent script is flash_all.sh , which requires proper execution permissions: