2017-01-13 4 views
-1

방금 ​​완료 한 배치 파일을 작성하는 중입니다. 그러나 나는 단지 명령이 제대로 실행되지 않으면 실행을 멈출 수 있는지 알고 싶었습니다. 그래도 명령이 망가질 경우 내 전화가 힘들어 질 것이며 우리 중 누구도 그렇게되기를 원하지 않을 것입니다. 그래서, 어떻게 멈추게합니까 ??명령을 일괄 적으로 실행하는 중 오류가있는 경우 중지하십시오.

ECHO Brought to you by Rocker223 @XDA 
ECHO -__-__-__-__-__-__-__-__-__-__- 
ECHO. 
Echo  Motorolla MOTO G3(2015) 
ECHO   Reset tool 
ECHO -__-__-__-__-__-__-__-__-__-__- 
cd /d %CD% 
title Reset your mobile! 
set p=0 
ECHO ---Making sure your phone is in fastboot mode--- 
ECHO Press c to Cancel! 
choice /c ync /M "Is your phone in fastboot mode" 
if %errorlevel% == 2 ECHO Rebooting 
if %errorlevel% == 2 adb reboot bootloader 
if %errorlevel% == 3 exit(0) 
title Flashing Partition file! Step:1 of 20 
ECHO Flashing Partition file! 
fastboot flash partition gpt.bin 
title Flashing bootloader! 
ECHO Flashing bootloader! 
fastboot flash bootloader bootloader.img 
title Flashing Logo! Step:2 of 20 
ECHO Flashing Logo! 
fastboot flash logo logo.bin 
title Flashing boot file! Step:3 of 20 
ECHO Flashing boot file! 
fastboot flash boot boot.img 
title Flashing Recovery! Step:4 of 20 
ECHO Flashing Recovery! 
fastboot flash recovery recovery.img 
set /a n=5 
Title flashinng system image Step:%n% of 20 
ECHO Flashing system image files might take a minute or two.... 
fastboot flash system system.img_sparsechunk.0 
set /a n=n+1 
Title flashinng system image Step:%n% of 20 
fastboot flash system system.img_sparsechunk.1 
set /a n=n+1 
Title flashinng system image Step:%n% of 20 
fastboot flash system system.img_sparsechunk.2 
set /a n=n+1 
Title flashinng system image Step:%n% of 20 
fastboot flash system system.img_sparsechunk.3 
set /a n=n+1 
Title flashinng system image Step:%n% of 20 
fastboot flash system system.img_sparsechunk.4 
set /a n=n+1 
Title flashinng system image Step:%n% of 20 
fastboot flash system system.img_sparsechunk.5 
set /a n=n+1 
Title flashinng system image Step:%n% of 20 
fastboot flash system system.img_sparsechunk.6 
set /a n=n+1 
Title flashinng system image Step:%n% of 20 
fastboot flash system system.img_sparsechunk.7 
set /a n=n+1 
Title Finalising... Step:%n% of 20 
ECHO Finalising... 
fastboot flash modem NON-HLOS.bin 
set /a n=n+1 
Title Finalising... Step:%n% of 20 
fastboot erase modemst1 
set /a n=n+1 
Title Finalising... Step:%n% of 20 
fastboot erase modemst2 
set /a n=n+1 
Title Finalising... Step:%n% of 20 
fastboot flash fsg fsg.mbn 
set /a n=n+1 
title Erasing Data... Step:%n% of 20 
ECHO Erasing Data... 
fastboot erase cache 
set /a n=n+1 
title Erasing Data... Step:%n% of 20 
fastboot erase userdata 
set /a n=n+1 
title Rebooting your phone! Step:%n% of 20 
ECHO Rebooting your phone! 
fastboot reboot 
title Finished! 
ECHO All Done! Phone has been reset successfully! 
+0

는 http://stackoverflow.com/questions/734598/how-do-i-make-a-batch-에서보세요 파일 종료시 오류 발생 – olikaf

+0

다음을 읽어보십시오. [mcve] – aschipfl

+0

그건 그렇고 : exit (0)는 매우 흥미 롭습니다. 명령 줄 __script를 __script __와 __program을 function__로 작성했습니다. 이 명령과 올바른 사용법에 대한 도움말은 명령 프롬프트 창'exit /? '에서 실행하십시오. exit/B 0을 사용하는 것이 좋습니다. – Mofi

답변

0

당신은 일괄 적으로 각 명령 다음에 오류 수준 를 확인해야하는 것은

관련 문제