Iview i896QW

@echo off

title Rev:11.0.2.1

@rem This script is called by x:WindowsSystem32Startnet.cmd – WinPE

@rem *******************************************************************

@rem FLASH_BIOS=1 Auto flash BIOS

@rem FLASH_BIOS=0 Do not auto flash BIOS

@rem *******************************************************************

set FLASH_BIOS=0

@rem *******************************************************************

set PPKG_FILE=1

@rem *******************************************************************

@echo.

@echo Running Intel Optimization powercfg for improved imaging times

@echo.

@echo call powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

call powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

@echo.

@rem *****************************************************************

@rem List all the disks, then search the volumes of each one to see

@rem which disks may have “Winpe” in the label. We will ignore that

@rem disk and use the first disk without the Winpe label that we find.

@rem *****************************************************************

@echo.>x:listdisk.txt

@echo list disk>>x:listdisk.txt

@echo exit>>x:listdisk.txt

echo x:listdisk.txt

@echo call diskpart /s x:listdisk.txt

call diskpart /s x:listdisk.txt>x:Disks.txt

if %ERRORLEVEL% NEQ 0 echo Diskpart error && goto :Error

@rem Set Disk equal to blank to start

set disk=

@echo.

@rem

@rem This line will write a diskpart script to select the disk and detail it’s contents.

@rem We use this output to find a disk that does NOT have Winpe as the volume label.

@rem That disk will have the OS installed to it. This way you can exclude USB from diskpart.

@rem

@rem This works around the issue where the USB key is sometimes enumerated as disk 0 and the

@rem SSD is disk 1.

@rem

for /f “skip=8 tokens=2” %%A in (x:Disks.txt) do (

@echo sel disk %%A>x:Par.txt

@echo det disk>>x:Par.txt

@echo exit>>x:Par.txt

if NOT “%%A”==”DiskPart…” call :ListPar %%A

)

if “%Disk%”==”” echo No disk found without a volume label of “Winpe”&& set disk=0

@echo Using Disk “%Disk%”

@echo.

@echo *****************************************************************

@echo Checkup SingleOS or DualOS or whether exist windows partiton

@echo *****************************************************************

@rem create diskpart script for search windows partitions from emmc disk

@echo.>x:ListPar.txt

@echo select disk “%Disk%” >>x:ListPar.txt

@echo list partition >>x:ListPar.txt

@echo exit >>x:ListPar.txt

@echo.

@rem run diskpart script

diskpart /s x:ListPar.txt >x:eMMCPar.txt

if %ERRORLEVEL% NEQ 0 echo Diskpart error && goto :Error

@echo.

@rem SingleOS / DualOS switch

find “Partition 10” x:eMMCPar.txt >nul

if %ERRORLEVEL% NEQ 0 set OS=SingleOS&& goto :P artition

@rem set android volume hide

@echo. >x:HideVol.txt

@echo select disk “%Disk%”>>x:HideVol.txt

for /f “tokens=2” %%i in (‘type x:VolumeList.txt ^| find “RAW”‘) do (

@echo Select Volume %%i >>x:HideVol.txt

@echo attributes volume set hidden >>x:HideVol.txt

)

@echo call diskpart /s x:HideVol.txt

call diskpart /s x:HideVol.txt

@rem ensure it’s DualOS,and check whether exist windows partition,if not:create the new windows partition

find “Partition 16” x:eMMCPar.txt >nul

if %ERRORLEVEL% NEQ 0 set OS=DualOS&& goto :P artition

@echo. >x:WinPar.txt

@echo. >x:DelPar.txt

@echo select disk “%Disk%”>>x:WinPar.txt

@echo select disk “%Disk%”>>x:DelPar.txt

for /f “skip=1 tokens=2” %%i in (‘type x:eMMCPar.txt ^| find “Partition”‘) do (

@echo select disk “%Disk%”>x:WinPar.txt

@echo select Partition %%i>>x:WinPar.txt

@echo detail partition >>x:WinPar.txt

@echo exit >>x:WinPar.txt

diskpart /s x:WinPar.txt>x:ParPro.txt

if %ERRORLEVEL% NEQ 0 echo Diskpart error && goto :Error

type x:ParPro.txt | find “* Volume” >x:VolPro.txt

for /f “tokens=3” %%j in (‘type x:VolPro.txt ^| find /v “RAW” ^| find /v “ESP” ^| find /v “WINPE”‘) do (

@echo select disk “%Disk%”>x:DelPar.txt

@echo select partition %%i >>x:DelPar.txt

@echo delete Partition override >>x:DelPar.txt

@echo exit >>x:DelPar.txt

diskpart /s x:DelPar.txt

)

)

set OS=DualOS&& goto :P artition

:P artition

@echo.

@echo *****************************************************************

@echo Write the diskpart script now that we know what disk to use

@echo *****************************************************************

:: SingleOS

if “%OS%”==”SingleOS” (

@echo call :P arSingleOS

call :P arSingleOS

)

:: DualOS

if “%OS%”==”DualOS” (

@echo call :P arDualOS

call :P arDualOS

)

@echo Winpart.txt now contains…..

type x:winpart.txt

@echo.

@echo *****************************************************************

@echo Setting up the partition table

@echo *****************************************************************

@echo call diskpart /s x:winpart.txt

diskpart /s x:winpart.txt

if %ERRORLEVEL% NEQ 0 echo Diskpart error && goto :Error

@echo.

@echo *****************************************************************

@rem Map drive letter for Install.wim

@echo *****************************************************************

@echo.>x:ListVol.txt

@echo List volume>>x:ListVol.txt

@echo exit>>x:ListVol.txt

@echo call diskpart /s x:ListVol.txt

call diskpart /s x:ListVol.txt>x:Output.txt

if %ERRORLEVEL% NEQ 0 echo Diskpart error && goto :Error

@echo.

@rem Go through each drive letter, looking for the imagesInstall.txt file

for /f “skip=8 tokens=3” %%A in (x:Output.txt) do (

if exist %%A:imagesinstall.txt set InstallPath=%%A:images&& echo “Found device with images folder and install.txt file”

if exist %%A:images set InstallPath=%%A:images&& echo “Found device with images folder”

)

@echo.

@rem Check InstallPath was found and there are images in it.

@echo.

@echo *****************************************************************

@rem Select install.wim

@echo *****************************************************************

@echo.

setlocal enabledelayedexpansion

cd /d %InstallPath%

set num=””

for /f “delims=” %%i in (‘dir /a-d /b *.wim’) do (

set /a num+=1

if “!num!” == “!num!” set WIM_NAME!num!=%%i

)

if NOT “%WIM_NAME3%”==”” echo Can not select *.WIM && goto :Error

set TARGET_WIM=%WIM_NAME1%

if /i “%TARGET_WIM%”==”Winre.wim” (

set TARGET_WIM=%WIM_NAME2%

)

@echo %TARGET_WIM%

if “%TARGET_WIM%”==”” echo The windows image name not specified && goto :Error

if NOT EXIST %InstallPath%%TARGET_WIM% echo “Install.wim NOT found.” && goto :Error

@echo Install.wim FOUND at %InstallPath%imagesinstall.wim

@echo.

@echo Making directories…

md w:recyclerscratch

if %errorlevel% NEQ 0 echo “Failed to make w:recyclerscratch directory” && goto :error

@echo.

md z:recoverywindowsre

if %errorlevel% NEQ 0 echo “Failed to make z:recoverywindowsre directory” && goto :error

@echo.

@echo *****************************************************************

@echo Applying the Windows image from the USB

@echo *****************************************************************

@echo call dism /apply-image /imagefile:”%InstallPath%%TARGET_WIM%” /index:1 /applydir:w: /scratchdir:”w:recyclerSCRATCH

call dism /apply-image /imagefile:”%InstallPath%%TARGET_WIM%” /index:1 /applydir:w: /scratchdir:”w:recyclerSCRATCH

if %errorlevel% NEQ 0 echo “Failed to apply image to w:” && goto :error

@echo.

@echo *****************************************************************

@rem Move WinRE to Recovery Partition

@echo *****************************************************************

@echo.

@echo Modifying attributes of winre.wim so we can move it.

attrib w:WindowsSystem32recoverywinre.wim -s -h -a -r

@echo if EXIST w:WindowsSystem32recoverywinre.wim move w:WindowsSystem32recoverywinre.wim z:recoverywindowsre

if EXIST w:WindowsSystem32recoverywinre.wim move w:WindowsSystem32recoverywinre.wim z:recoverywindowsre

if %errorlevel% NEQ 0 echo “Failed to move winre.wim to z:recoverywindowsre” && goto :error

@echo.

@echo xcopy %InstallPath%WinreWinre.wim z:recoverywindowsre /y

xcopy %InstallPath%Winre.wim z:recoverywindowsre /y

if %errorlevel% NEQ 0 echo “Failed to copy winre.wim to z:recoverywindowsre” && goto :error

@echo.

@echo reset attributes now

attrib z:RecoveryWindowsrewinre.wim +s +h +a +r

@echo.

@echo *****************************************************************

@echo Setting the boot environment

@echo *****************************************************************

if “%OS%”==”SingleOS” (

@echo call w:WINDOWSSYSTEM32BCDBOOT w:WINDOWS /s s: /f all

call w:WINDOWSSYSTEM32BCDBOOT w:WINDOWS /s s: /f all

if %errorlevel% NEQ 0 echo “Failed to set boot information” && goto :error

)

if “%OS%”==”DualOS” (

@echo call w:WINDOWSSYSTEM32BCDBOOT w:WINDOWS

w:WINDOWSSYSTEM32BCDBOOT w:WINDOWS

if %errorlevel% NEQ 0 echo “Failed to set boot information” && goto :error

%WinPESource%ScriptsToolsH2OUVE-W-Q2S.exe

if EXIST w:”Program Files”H2OUVE-W.exe del /q w:”Program Files”H2OUVE-W.exe

if EXIST w:”Program Files”RunQ2S.bat del /q w:”Program Files”RunQ2S.bat

if EXIST w:”Program Files”VarDate.xml del /q w:”Program Files”VarDate.xml

if EXIST w:”Program Files”VarEdit.txt del /q w:”Program Files”VarEdit.txt

)

@echo *****************************************************************

@echo Setting the recovery environment

@echo *****************************************************************

@echo w:windowssystem32reagentc /SetREImage /Path z:RECOVERYWINDOWSRE /target w:windows

w:windowssystem32reagentc /SetREImage /Path z:RECOVERYWINDOWSRE /target w:windows

if %errorlevel% NEQ 0 echo “Failed to set recovery information” && goto :error

@echo.

rmdir /s /q w:recycler

@echo.

if “%FLASH_BIOS%”==”1” goto :FLASH_BIOS

goto :END

:FLASH_BIOS

@echo.

@echo *****************************************************************

@echo Flashing BIOS…

@echo *****************************************************************

@echo.

@echo BIOS file FOUND at %InstallPath%BIOS*.ROM

@echo.

xcopy /y %InstallPath%BIOS*.ROM %WinPESource%ScriptsTools

for /r “%WinPESource%ScriptsTools” %%Z in (*.ROM) do (

ren “%%Z” “%%~na.fd”

)

if NOT EXIST %WinPESource%ScriptsTools*.fd echo “Can not find the BIOS file” && goto :error

@REM Flash BIOS

%WinPESource%ScriptsToolsH2OFFT-W.exe

Del /q %WinPESource%ScriptsTools*.fd

if %errorlevel% NEQ 0 echo “Failed to flash BIOS” && goto :error

@echo *****************************************************************

@echo Image deployment COMPLETE. Type EXIT from Command

@echo Prompt to restart or turn off device.

@echo *****************************************************************

goto :END

:ERROR

color 4f

@echo.

@echo An error has been detected.

@echo.

@echo Input Ctrl + C to exit

pause >nul

goto :ERROR

:ListPar

@REM This section is to bring a disk number and use it to List Partitions

@echo.

set TempDisk=%1

diskpart /s x:Par.txt>x:ParOutput.txt

if %ERRORLEVEL% NEQ 0 echo Diskpart error && goto :Error

for /f “skip=26 tokens=4” %%A in (x:ParOutput.txt) do (

if /i NOT “%%A”==”Winpe” set Disk=%TempDisk%

)

goto :EOF

:P arSingleOS

@echo.>x:winpart.txt

@echo select disk “%Disk%”>>x:winpart.txt

@echo clean>>x:winpart.txt

@echo convert gpt>>x:winpart.txt

@echo create partition efi size=100>>x:winpart.txt

@echo format quick fs=fat32 label=”System”>>x:winpart.txt

@echo assign letter=”S”>>x:winpart.txt

@echo create partition msr size=128>>x:winpart.txt

@echo create partition primary>>x:winpart.txt

@echo format quick fs=ntfs label=”Windows”>>x:winpart.txt

@echo assign letter=”W”>>x:winpart.txt

@echo shrink desired=450>>x:winpart.txt

@echo create partition primary>>x:winpart.txt

@echo format quick fs=ntfs label=”Recovery”>>x:winpart.txt

@echo assign letter=”Z”>>x:winpart.txt

@echo set>>x:winpart.txt

@echo gpt attributes=0×8000000000000001>>x:winpart.txt

@echo exit>>x:WinPart.txt

goto :EOF

:P arDualOS

@echo.>x:winpart.txt

@echo select disk “%Disk%”>>x:winpart.txt

@echo create partition msr size=128>>x:winpart.txt

@echo create partition primary>>x:winpart.txt

@echo format quick fs=ntfs label=”Windows”>>x:winpart.txt

@echo assign letter=”W”>>x:winpart.txt

@echo shrink desired=450>>x:winpart.txt

@echo create partition primary>>x:winpart.txt

@echo format quick fs=ntfs label=”Recovery”>>x:winpart.txt

@echo assign letter=”Z”>>x:winpart.txt

@echo set>>x:winpart.txt

@echo gpt attributes=0×8000000000000001>>x:winpart.txt

@echo exit>>x:WinPart.txt

goto :EOF

:END

@echo.

@echo *****************************************************************

@echo Copy over Test tools to TEST_TOOL

@echo TEST_TOOL SHOULD BE DELETED PRIOR TO SHIPPING

@echo *****************************************************************

@echo %WinpeSource%Scripts7za.exe x w:TEST_TOOL.zip -oW:

if EXIST %WinpeSource%TEST_TOOL.zip %WinpeSource%Scripts7za.exe x %WinpeSource%TEST_TOOL.zip -oW:

@echo.

@echo *****************************************************************

@echo Copying over Unattend.xml to use on factory floor if it exists

@echo *****************************************************************

@echo if EXIST %InstallPath%Unattend.xml copy %InstallPath%Unattend.xml w:WindowsPanther /y

if EXIST %InstallPath%Unattend.xml copy %InstallPath%Unattend.xml w:WindowsPanther /y

@echo *****************************************************************

@echo Copying over Unattend.xml to use on factory floor if it exists

@echo *****************************************************************

@echo if EXIST %InstallPath%LayoutModification.xml copy %InstallPath%LayoutModification.xml w:UsersDefaultAppDataLocalMicrosoftWindowsShell /y

if EXIST %InstallPath%LayoutModification.xml copy %InstallPath%LayoutModification.xml w:UsersDefaultAppDataLocalMicrosoftWindowsShell /y

if EXIST %InstallPath%DefaultLayouts.xml copy %InstallPath%DefaultLayouts.xml w:UsersDefaultAppDataLocalMicrosoftWindowsShell /y

@echo.

@echo *****************************************************************

@echo Copying over NON Scanstate Packages, if they exist.

@echo IF YOU COPY OVER SCANSTATE PPKG, THIS CAUSE IMAGE TO FAIL DURING RECOVERY

@echo *****************************************************************

@echo.

@echo if EXIST %InstallPath%*.ppkg copy %InstallPath%*.ppkg w:RecoveryCustomizations /y

if EXIST %InstallPath%*.ppkg copy %InstallPath%*.ppkg w:RecoveryCustomizations /y

set PPKG_PATH=w:RecoveryCustomizations

@echo Apply PPKG

if “%PPKG_FILE%”==”1” (

setlocal enabledelayedexpansion

cd /d %PPKG_PATH%

set num=””

for /f “delims=” %%i in (‘dir /a-d /b *.ppkg’) do (

set /a num+=1

if “!num!” == “!num!” (

@echo if /i “%%~ni”==”usmt” DISM /Apply-CustomDataImage /CustomDataImage:!PPKG_PATH!%%~ni.ppkg /ImagePath:w: /SingleInstance

if /i “%%~ni”==”usmt” DISM /Apply-CustomDataImage /CustomDataImage:!PPKG_PATH!%%~ni.ppkg /ImagePath:w: /SingleInstance

@echo if /i NOT “%%~ni”==”usmt” DISM.exe /Image:w: /Add-ProvisioningPackage /PackagePath:!PPKG_PATH!%%~ni.ppkg

if /i NOT “%%~ni”==”usmt” DISM.exe /Image:w: /Add-ProvisioningPackage /PackagePath:!PPKG_PATH!%%~ni.ppkg

)

)

)

if “%PPKG_FILE%”==”0” del /s /q %PPKG_PATH%usmt.ppkg

@echo.

@echo *****************************************************************

@echo Image deployment COMPLETE. Type EXIT from Command

@echo Prompt to restart or turn off device.

@echo *****************************************************************

@rem

@rem Get finish time so we can evaluate total WinPE phase time.

@rem

call |time>x:StopTime.txt

@rem

@rem Now parse both files to display the Start and Finish Time

@rem

@echo.

for /f “tokens=5” %%A in (x:starttime.txt) do echo Script Start Time is %%A

for /f “tokens=5” %%A in (x:stoptime.txt) do echo Script Stop Time is %%A

@echo.

exit

GET 1 USD FOR LINK DOWNLOAD

NOTE: contact via email [email protected] , i will sent link download for you

More from my site

  • MAXCOM MS553 DESCRIPTION ROM Mobile MAXCOM MS553– ROM Android 7.0 ONLY MT6737M Update Official Rom […]
  • JLINKSZ XQ107-D3 5M DESCRIPTION ROM Tablet JLINKSZ XQ107-D3 5M – ROM Android 10 ONLY MT6765 ROM Official […]
  • BU P28 DESCRIPTION ROM Mobile BU P28 – ROM Android 4.4.2 ONLY MT6572 Official ROM BU P28 […]
  • Conquest F2 Mini Recovery DESCRIPTION Recovery Mobile Conquest F2 Mini – 3.2.3 Flash Recovery: Step 1: Enable […]
  • EMOTO E8 DESCRIPTION ROM Mobile EMOTO E8 – ROM Android 2.3.6 ONLY MT6575 ROM Official EMOTO […]
  • Stock Rom APlus Gen4 C Download Firmware A Plus Gen4cDownloadrom aplus gen 4 […]
  • Wiko Rainbow Lite DESCRIPTION ROM Phone Wiko Rainbow Lite – ROM Android 5.0 ONLY MT6582 Official ROM […]
  • Wikoo S26 MT6572 Official Stock Firmware Wikoo S26 MT6572 Official Stock Firmware Readme Once: Take a Backup: If you are going […]
  • Gright G101 4.2 DESCRIPTION ROM Tablet Gright G101 - ROM Android 4.2.2 ONLY MT6572 Official Rom […]
  • How to Flash Stock Rom on Lava Z5 MT6737M S100 How to Flash Stock Rom on Lava Z5 MT6737M S100 We are going to Flash Stock Rom on […]
  • itel L5006C ONLY SC9832e ROM 2 – Update Official itel L5006C version: […]
  • InFocus Bingo 50 Plus DESCRIPTION ROM Phone InFocus Bingo 50 Plus – ROM Android 6.0 ONLY MT6753 Official […]