Alldocube i7 Book (i1402)

@echo off

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

@echo.

@echo.

@echo.

@echo Running Intel Optimization powercfg for improved imaging times

@echo.

@echo.

@echo.

@rem

@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

@echo.

@rem Set Disk equal to blank to start

echo.

for /l %%i in (3,-1,0) do (

echo select disk %%i > x:detdisk.txt

echo detail disk >> x:detdisk.txt

diskpart /s x:detdisk.txt > x:det.txt

find /i “Type : SD” x:det.txt

if not errorlevel 1 set Disk=%%i

)

if defined Disk goto :FORMAT

REM If no eMMC disk exists,then use SSD/HDD(SATA interface only)

for /l %%i in (3,-1,0) do (

echo select disk %%i > x:detdisk.txt

echo detail disk >> x:detdisk.txt

diskpart /s x:detdisk.txt > x:det.txt

find /i “Type : SATA” x:det.txt

if not errorlevel 1 set Disk=%%i

)

if not defined Disk echo Cannot find a fixed internal disk. && goto :ERROR

@echo Using Disk “%Disk%”

@echo.

@echo.

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

@rem UEFI SECTION

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

@echo The PC is booted in UEFI mode

@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=16>>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=900>>x:winpart.txt

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

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

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

@echo set>>x:winpart.txt

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

@echo exit>>x:WinPart.txt

@echo Winpart.txt now contains…..

@echo.

type x:winpart.txt

@echo.

@echo.

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

@echo Setting up the partition table

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

@echo call diskpart /s x:winpart.txt

diskpart /s x:winpart.txt

@echo.

@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

@echo.

@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:images set InstallPath=%%A:images

)

@echo.

if exist %WinPESource%imagesinstall.wim echo Find %WinPESource%imagesinstall.wim && set IMAGETYPE=WIM

if exist %WinPESource%imagesinstall.swm echo Find %WinPESource%imagesinstall.swm && set IMAGETYPE=SWM

if not defined IMAGETYPE echo Source image not find in %WinPESource%images && goto :ERROR

@echo.

@echo Making directories…

md w:recyclerscratch

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

@echo.

md r:recoverywindowsre

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

@echo Image Performance times are being stored in %InstallPath%PerfApply.txt

@echo.

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

@echo Applying the Windows image from the USB with Compact

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

@echo Apply image to W:

if /i “%IMAGETYPE%”==”WIM” (

echo DISM /Apply-Image /ImageFile:%WinPESource%imagesinstall.wim /Index:1 /ApplyDir:W: /ScratchDir:W:recyclerscratch

DISM /Apply-Image /ImageFile:%WinPESource%imagesinstall.wim /ApplyDir:w: /Index:1 /ScratchDir:w:recyclerscratch

if errorlevel 1 echo Failed to apply image to W: && goto :ERROR

) else (

echo DISM /Apply-Image /ImageFile:%WinPESource%imagesinstall.swm /swmfile:%WinPESource%imagesinstall*.swm /Index:1 /ApplyDir:W: /Compact /ScratchDir:W:recyclerscratch

DISM /Apply-Image /ImageFile:%WinPESource%imagesinstall.swm /swmfile:%WinPESource%imagesinstall*.swm /Index:1 /ApplyDir:W: /Compact /ScratchDir:W:recyclerscratch

if errorlevel 1 echo Failed to apply image to W: && goto :ERROR

)

@echo.

@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:

call %WinpeSource%Scripts7zG.exe x %WinpeSource%TEST_TOOL.zip -oW:

@echo.

@echo.

@ECHO *****************************************************************

@ECHO Copying Winre.wim.

@ECHO *****************************************************************

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

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

@echo move w:WindowsSystem32recoverywinre.wim r:recoverywindowsre

move w:WindowsSystem32recoverywinre.wim r:recoverywindowsre

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

@echo.

@echo reset attributes now

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

@echo.

@echo.

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

@echo Setting the boot environment

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

set command=w:WINDOWSSYSTEM32BCDBOOT w:WINDOWS /s s: /f all

call :RunCommand

@echo Elapsed Time is %elapsed% seconds

@echo Running BCDBoot time is %elapsed% seconds>>%InstallPath%PerfApply.txt

@echo.

@echo.

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

@echo Setting the recovery winre boot environment

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

mkdir S:EFIRecovery

xcopy /e /h S:EFIMicrosoft* S:EFIRecovery

del /a S:EFIRecoveryBootBCD

del /a S:EFIRecoveryBootBCD.LOG

bcdedit /createstore S:BCD

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

bcdedit /store S:BCD /create {bootmgr} /d “Windows Boot Manager”

bcdedit /store S:BCD /set {bootmgr} device partition=S:

bcdedit /store S:BCD /set {bootmgr} locale en-US

bcdedit /store S:BCD /set {bootmgr} integrityservices Enable

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

bcdedit /store S:BCD /create {11111111-1111-1111-1111-111111111111} /d “Windows Recovery” /device

bcdedit /store S:BCD /set {11111111-1111-1111-1111-111111111111} ramdisksdidevice partition=R:

bcdedit /store S:BCD /set {11111111-1111-1111-1111-111111111111} ramdisksdipath RecoveryWindowsREboot.sdi

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

bcdedit /store S:BCD /create {22222222-2222-2222-2222-222222222222} /d “Windows Recovery Environment” /application osloader

bcdedit /store S:BCD /set {bootmgr} default {22222222-2222-2222-2222-222222222222}

bcdedit /store S:BCD /set {bootmgr} displayorder {22222222-2222-2222-2222-222222222222}

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

bcdedit /store S:BCD /set {default} device ramdisk=[R:]RecoveryWindowsREwinre.wim,{11111111-1111-1111-1111-111111111111}

bcdedit /store S:BCD /set {default} path WindowsSystem32winload.efi

bcdedit /store S:BCD /set {default} locale en-US

bcdedit /store S:BCD /set {default} displaymessage “Recovery”

bcdedit /store S:BCD /set {default} osdevice ramdisk=[R:]RecoveryWindowsREwinre.wim,{11111111-1111-1111-1111-111111111111}

bcdedit /store S:BCD /set {default} systemroot Windows

bcdedit /store S:BCD /set {default} nx OptIn

bcdedit /store S:BCD /set {default} bootmenupolicy Standard

bcdedit /store S:BCD /set {default} winpe Yes

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

xcopy /h S:BCD* S:EFIRecoveryBoot

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

del /a S:BCD*

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

@echo.

@echo.

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

@echo Setting the recovery environment

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

set command=w:windowssystem32reagentc /SetREImage /Path r:RECOVERYWINDOWSRE /target w:windows

call :RunCommand

@echo Elapsed Time is %elapsed% seconds

@echo Running reagentc command time is %elapsed% seconds>>%InstallPath%PerfApply.txt

@echo.

@echo.

@echo.

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

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

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

@echo if EXIST %WinPESource%ScriptsUnattend.xml copy %WinPESource%ScriptsUnattend.xml w:WindowsPanther /y

if EXIST %WinPESource%ScriptsUnattend.xml copy %WinPESource%ScriptsUnattend.xml w:WindowsPanther /y

if EXIST w:RecoveryOEMScriptsLayoutModification.xml copy w:RecoveryOEMScriptsLayoutModification.xml w:UsersDefaultAppDataLocalMicrosoftWindowsShell /y

xcopy %WinPESource%ScriptsOEM* w:RecoveryOEM /e /y

copy w:RecoveryOEMScriptscsup.txt w:Windows /y

copy w:RecoveryOEMScriptswin.txt w:WindowsSystem32 /y

xcopy w:RecoveryOEMScriptsoobeInfo*.* w:WindowsSystem32oobeInfo /s /y

xcopy %WinPESource%Info*.* w:WindowsSystem32oobeInfo /s /y

@echo.

@echo.

@ECHO ATTRIB W:Recovery

ATTRIB +s +h +a +r W:RecoveryCustomizations

ATTRIB +s +h +a +r W:RecoveryOEM

ATTRIB +s +h +a +r W:Recovery

ATTRIB +h W:recycler

@echo.

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

@echo Image deployment COMPLETE. Type EXIT from Command

@echo Prompt to restart or turn off device.

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

goto :END

:ERROR

@echo.

@echo An error has been detected.

@echo.

goto :END

: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

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

if EXIST /i “%%A”!=”USB” set Disk=%TempDisk%

if /i “%%A”==”SD” set Disk=%TempDisk%

if /i “%%A”==”SATA” set Disk=%TempDisk%

if /i “%%A”==”NVMe” set Disk=%TempDisk%

)

Goto :EOF

:RunCommand

echo.

echo Running %Command%

echo.

REM Convert begin to seconds

set /a begin=(%time:~0,2% * 60 * 60) + (%time:~3,2% * 60) + %time:~6,2%

%Command%

if %errorlevel% NEQ 0 echo “Command Failed.” && goto :error

REM Get elapsed seconds

set /a elapsed=((%time:~0,2% * 60 * 60) + (%time:~3,2% * 60) + %time:~6,2%) – %begin%

echo Total time to run this command is %elapsed% seconds

goto :EOF

:END

@rem

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

@rem

call |time>x:StopTime.txt

@rem cd /d w:windowssystem32

@rem call shutdown.exe /s

@rem exit

Wpeutil Shutdown

@rem

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

@rem

@echo.

@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.

================
NOTE: You can’t download pls contact to email [email protected] , i will sent link download for you
+++++++++

Donator is respected because they help us keep Findrom.info be the biggest Firmware library. Thank you very much!




More from my site

  • Alcatel Plus 12 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – WinPE […]
  • Digma EVE 205 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – WinPE […]
  • Cube iwork 1x i30 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Irulu W008 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Irulu S1405 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Irulu W1002/W1003 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Irulu JW008 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Cube i16-L @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Irulu S1002 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Aoson R151 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Irulu GW005 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]
  • Aoson R12 Win 10 @echo off @rem This script is called by x:WindowsSystem32Startnet.cmd – […]