@echo off
title Partitions Flashing Tool for ZTE Blade V9 Vita v1.2 English
@md .\backup
@md .\files
:startmenu
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *  1. DFU to EDL mode changer                     *
@echo *                                                 *
@echo *  2. ADB to EDL mode changer                     *
@echo *                                                 *
@echo *  3. Full backup all partitions                  *
@echo *                                                 *
@echo *  4. Backup one partition                        *
@echo *                                                 *
@echo *  5. Flash one partition                         *
@echo *                                                 *
@echo *=================================================*
@set /p menuid="Enter menu number: "
@if %menuid% equ 1 goto dfutoedl
@if %menuid% equ 2 goto adbtoedl
@if %menuid% equ 3 goto fullbackup
@if %menuid% equ 4 goto backuppart
@if %menuid% equ 5 goto flashpart
@if %menuid% geq 6 goto wrongmenu
:wrongmenu
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *            !!!Wrong menu number!!!              *
@echo *                                                 *
@echo *=================================================*
@pause
@goto startmenu
:dfutoedl
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *  1. DFU to EDL mode changer                     *
@echo *                                                 *
@echo *=================================================*
@set /p dfucom="Enter DFU mode COM-port number: "
@tools\emmcdl.exe -p com%dfucom% -raw 0xFE
@pause
@if %errorlevel% equ 0 goto startmenu
@if %errorlevel% geq 1 goto dfuerrmsg
:dfuerrmsg
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *     !!!Failed to change DFU to EDL mode!!!      *
@echo *                                                 *
@echo *           Please check the following:           *
@echo *                                                 *
@echo *   1) DFU mode is already activated;             *
@echo *                                                 *
@echo *   2) DFU drivers are installed correctly;       *
@echo *                                                 *
@echo *   3) DFU mode COM-port in Device Manager;       *
@echo *                                                 *
@echo *   4) USB cable is working.                      *
@echo *                                                 *
@echo *=================================================*
@pause
@goto startmenu
:adbtoedl
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *  2. ADB to EDL mode changer                     *
@echo *                                                 *
@echo *=================================================*
@tools\adb.exe reboot edl
@pause
@if %errorlevel% equ 0 goto startmenu
@if %errorlevel% geq 1 goto adberrmsg
:adberrmsg
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *     !!!Failed to change ADB to EDL mode!!!      *
@echo *                                                 *
@echo *           Please check the following:           *
@echo *                                                 *
@echo *   1) ADB Debugging is already activated;        *
@echo *                                                 *
@echo *   2) ADB drivers are installed correctly;       *
@echo *                                                 *
@echo *   3) USB cable is working.                      *
@echo *                                                 *
@echo *=================================================*
@pause
@goto startmenu
:fullbackup
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *  3. Full backup all partitions                  *
@echo *                                                 *
@echo *=================================================*
@set /p edlcom="Enter EDL mode COM-port number: "
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d aboot -o backup\aboot.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d abootbak -o backup\abootbak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d apdp -o backup\apdp.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d batweak -o backup\batweak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d boot -o backup\boot.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d cache -o backup\cache.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d cmnlib -o backup\cmnlib.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d cmnlib64 -o backup\cmnlib64.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d cmnlib64bak -o backup\cmnlib64bak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d cmnlibbak -o backup\cmnlibbak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d config -o backup\config.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d DDR -o backup\DDR.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d devcfg -o backup\devcfg.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d devcfgbak -o backup\devcfgbak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d devinfo -o backup\devinfo.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d dip -o backup\dip.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d dpo -o backup\dpo.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d dsp -o backup\dsp.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d factory -o backup\factory.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d fingerid -o backup\fingerid.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d fsc -o backup\fsc.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d fsg -o backup\fsg.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d keymaster -o backup\keymaster.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d keymasterbak -o backup\keymasterbak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d keystore -o backup\keystore.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d limits -o backup\limits.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d logdump -o backup\logdump.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d mcfg -o backup\mcfg.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d mdtp -o backup\mdtp.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d misc -o backup\misc.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d modem -o backup\modem.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d modemst1 -o backup\modemst1.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d modemst2 -o backup\modemst2.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d mota -o backup\mota.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d msadp -o backup\msadp.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d oem -o backup\oem.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d persist -o backup\persist.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d recovery -o backup\recovery.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d rpm -o backup\rpm.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d rpmbak -o backup\rpmbak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d sbl1 -o backup\sbl1.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d sbl1bak -o backup\sbl1bak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d sec -o backup\sec.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d splash -o backup\splash.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d ssd -o backup\ssd.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d syscfg -o backup\syscfg.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d system -o backup\system.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d tz -o backup\tz.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d tzbak -o backup\tzbak.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d vendor -o backup\vendor.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d ztecfg -o backup\ztecfg.bin
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d userdata -o backup\userdata.bin
@pause
@if %errorlevel% equ 0 goto startmenu
@if %errorlevel% geq 1 goto fullbackuperrmsg
:fullbackuperrmsg
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *     !!!Failed to full backup partitions!!!      *
@echo *                                                 *
@echo *          Please check the following:            *
@echo *                                                 *
@echo *   1) EDL mode is already activated;             *
@echo *                                                 *
@echo *   2) EDL drivers are installed correctly;       *
@echo *                                                 *
@echo *   3) EDL mode COM-port in Device Manager;       *
@echo *                                                 *
@echo *   4) USB cable is working;                      *
@echo *                                                 *
@echo *   5) "backup" folder is exists.                 *
@echo *                                                 *
@echo *=================================================*
@pause
@goto startmenu
:backuppart
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *  4. Backup one partition                        *
@echo *                                                 *
@echo *=================================================*
@set /p edlcom="Enter EDL mode COM-port number: "
@set /p targetpart="Enter target partition name: "
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -d %targetpart% -o backup\%targetpart%.bin
@pause
@if %errorlevel% equ 0 goto startmenu
@if %errorlevel% geq 1 goto backuperrmsg
:backuperrmsg
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *        !!!Failed to backup partition!!!         *
@echo *                                                 *
@echo *          Please check the following:            *
@echo *                                                 *
@echo *   1) EDL mode is already activated;             *
@echo *                                                 *
@echo *   2) EDL drivers are installed correctly;       *
@echo *                                                 *
@echo *   3) EDL mode COM-port in Device Manager;       *
@echo *                                                 *
@echo *   4) USB cable is working;                      *
@echo *                                                 *
@echo *   5) "backup" folder is exists;                 *
@echo *                                                 *
@echo *   6) Target partition name is correct.          *
@echo *                                                 *
@echo *=================================================*
@pause
@goto startmenu
:flashpart
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *  5. Flash one partition                         *
@echo *                                                 *
@echo *=================================================*
@set /p edlcom="Enter EDL mode COM-port number: "
@set /p targetpart="Enter target partition name: "
@set /p flashname="Enter flashing file name: "
@tools\emmcdl.exe -p com%edlcom% -f tools\emmc.mbn -b %targetpart% files\%flashname%.bin
@pause
@if %errorlevel% equ 0 goto startmenu
@if %errorlevel% geq 1 goto flasherrmsg
:flasherrmsg
cls
@echo *=================================================*
@echo *                                                 *
@echo * Partitions Flashing Tool for ZTE Blade V9 Vita  *
@echo *                                                 *
@echo *  Exclusively for 4pda.ru. Made by friendki11er  *
@echo *                                                 *
@echo *=================================================*
@echo *                                                 *
@echo *         !!!Failed to flash partition!!!         *
@echo *                                                 *
@echo *           Please check the following:           *
@echo *                                                 *
@echo *   1) EDL mode is already activated;             *
@echo *                                                 *
@echo *   2) EDL drivers are installed correctly;       *
@echo *                                                 *
@echo *   3) EDL mode COM-port in Device Manager;       *
@echo *                                                 *
@echo *   4) USB cable is working;                      *
@echo *                                                 *
@echo *   5) "files" folder is exists;                  *
@echo *                                                 *
@echo *   6) Target partition name is correct;          *
@echo *                                                 *
@echo *   7) Name of your dump file is correct.         *
@echo *                                                 *
@echo *=================================================*
@pause
@goto startmenu
