11@ echo off
2+ setlocal EnableExtensions
3+ setlocal
24if not " %~1 " == " " call :%~1
35if %Errorlevel% NEQ 0 goto :EOF
46:Check1
@@ -11,7 +13,7 @@ if EXIST M:\ (
1113 echo ----------------------------------------------------------------
1214 echo Please Unmount Drive [M:]
1315 pause
14- exit
16+ exit /B
1517)
1618echo - Checking Drive [N:] ...
1719if EXIST N:\ (
@@ -20,7 +22,7 @@ if EXIST N:\ (
2022 echo ----------------------------------------------------------------
2123 echo Please Unmount Drive [N:]
2224 pause
23- exit
25+ exit /B
2426)
2527:: ---------------------------------------------------------------
2628:GetAdministrator
@@ -59,7 +61,7 @@ if %WinBuild% LSS 9600 (
5961 echo Please use Windows 8.1+ Pro or Enterprise ^ (Build 9600+^ )
6062 echo Current OS build: %WinBuild%
6163 pause
62- exit
64+ exit /B
6365)
6466
6567echo - Checking Windows Powershell ...
@@ -73,7 +75,7 @@ if %PLV% NEQ 0 (
7375 echo Please enable Powershell and continue.
7476 echo Error code: %PLV%
7577 pause
76- exit
78+ exit /B
7779)
7880echo - Checking Dism ...
7981where DISM > nul
@@ -83,7 +85,7 @@ if %errorlevel% NEQ 0 (
8385 echo ----------------------------------------------------------------
8486 echo DISM isn't found or it has problem.
8587 pause
86- exit
88+ exit /B
8789)
8890echo - Checking Bcdedit ...
8991where bcdedit > nul
@@ -93,7 +95,7 @@ if %errorlevel% NEQ 0 (
9395 echo ----------------------------------------------------------------
9496 echo BCDEDIT wasn't found or it has problem.
9597 PAUSE
96- EXIT
98+ exit /B
9799)
98100
99101echo - Checking Hyper-V ...
@@ -104,7 +106,7 @@ if %errorlevel% NEQ 0 (
104106 echo ----------------------------------------------------------------
105107 echo Please enable Hyper-V in Windows Features.
106108 pause
107- exit
109+ exit /B
108110)
109111echo - Getting CmdLets ...
110112Powershell -C " (Get-Command).name" >> Commands.txt
@@ -142,15 +144,15 @@ echo ----------------------------------------------------------------
142144echo You used Windows 7 / Windows Home edition / Customized Windows.
143145echo Please use Official Windows 8.1 Pro or Windows 10 Pro
144146pause
145- exit
147+ exit /B
146148:MissingCommandHyperV
147149del Commands.txt
148150title ERROR!
149151color 0C
150152echo ----------------------------------------------------------------
151153echo Hyper-V is not fully enabled or not enabled correctly.
152154pause
153- exit
155+ exit /B
154156
155157
156158:ToBeContinued0
@@ -200,7 +202,7 @@ echo // %ESC%[97mby RedGreenBlue123%ESC%[93m
200202echo // %ESC% [97mThanks to: @Gus33000, @FadilFadz01, @Heathcliff74%ESC% [93m //
201203echo //////////////////////////////////////////////////////////////////////////////////////////////%ESC% [0m
202204echo .
203- echo %ESC% [92mChoose your Device Model below:
205+ echo %ESC% [92mChoose your device model below:
204206echo %ESC% [36m1) %ESC% [97mLumia 930
205207echo %ESC% [36m2) %ESC% [97mLumia 929 (Icon)
206208echo %ESC% [36m3) %ESC% [97mLumia 1520
@@ -358,13 +360,13 @@ if %Storage%==32 (
358360)
359361echo .
360362echo %ESC% [96m[INFO] Creating Partition Table ...%ESC% [91m
361- Powershell -C " Mount-VHD -Path %MainOS% \Data\windows10arm.vhdx; exit $Error.count" %SevLogger%
363+ Powershell -C " Mount-VHD -Path %MainOS% \Data\windows10arm.vhdx; exit /B $Error.count" %SevLogger%
362364Powershell -C " Initialize-Disk -Number (Get-VHD -Path %MainOS% \Data\windows10arm.vhdx).DiskNumber -PartitionStyle GPT -confirm:$false; exit $Error.count" %SevLogger%
363365:: Create ESP
364366echo .
365367echo %ESC% [96m[INFO] Creating EFI System Partition ...%ESC% [91m
366368Powershell -C " New-Partition -DiskNumber (Get-VHD -Path %MainOS% \Data\windows10arm.vhdx).DiskNumber -GptType '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}' -Size 100MB -DriveLetter M; exit $Error.count" %SevLogger%
367- Powershell -C " Format-Volume -DriveLetter M -FileSystem Fat32 -NewFileSystemLabel " ESP" -confirm:$false; exit $Error.count" %SevLogger%
369+ Powershell -C " Format-Volume -DriveLetter M -FileSystem Fat32 -NewFileSystemLabel " ESP" -confirm:$false; exit /B $Error.count" %SevLogger%
368370:: Create MSR
369371echo .
370372echo %ESC% [96m[INFO] Creating Microsoft Reserved Partition ...%ESC% [91m
@@ -474,7 +476,7 @@ echo %ESC%[96m[INFO] Installation is cancelled because a%ESC%[91m severe error %
474476echo %ESC% [33m[WARN] Please check installation log in Logs folder.%ESC% [0m
475477echo .
476478pause
477- exit
479+ exit /B
478480
479481:MissionCompleted
480482if %ErrNum% GTR 0 (
@@ -496,4 +498,4 @@ echo - Run PostInstall.bat.
496498echo ================================================================================================%ESC% [0m
497499echo .
498500pause
499- exit
501+ exit /b
0 commit comments