@echo off
@rem This script is called by x:\Windows\System32\Startnet.cmd – WinPE
@echo.
@echo.
@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.
@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
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.
@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=700>>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 id="de94bba4-06d1-4d40-a16a-bfd50179d6ac">>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 images\Install.txt file
for /f "skip=8 tokens=3" %%A in (x:\Output.txt) do (
if exist %%A:\images\install.txt set InstallPath=%%A:\images&& echo "Found device with images folder and install.txt file" && goto :Images
)
@echo.
@echo.
@rem Check InstallPath was found and there are images in it.
if NOT EXIST %InstallPath%\Install.swm echo "Install.wim NOT found." && goto :Error
:images
@echo Install.wim FOUND at %InstallPath%\images\install.wim
@echo.
@echo.
@echo Making directories…
md w:\recycler\scratch
if %errorlevel% NEQ 0 echo "Failed to make w:\recycler\scratch directory" && goto :error
@echo.
md r:\recovery\windowsre
if %errorlevel% NEQ 0 echo "Failed to make m:\recovery\windowsre directory" && goto :error
@echo Image Performance times are being stored in %InstallPath%\PerfApply.txt
@echo.
@echo.
@echo.
@echo *****************************************************************
@echo Applying the Windows image from the USB with Compact
@echo *****************************************************************
REM set command=DISM /Apply-Image /ImageFile:%InstallPath%\install.wim /Index:1 /ApplyDir:w:\ /Compact /ScratchDir:w:\recycler\SCRATCH
REM call :RunCommand
@echo Elapsed Time is %elapsed%
@echo Image Apply time with Compact is %elapsed% seconds>>%InstallPath%\PerfApply.txt
@echo *****************************************************************
@echo Applying the Windows image from the USB with Compact and Extended Attributes
@echo *****************************************************************
set command=DISM /Apply-Image /ImageFile:%InstallPath%\install.swm /SwmFile:%InstallPath%\install*.swm /Index:1 /ApplyDir:w:\ /Compact /EA /ScratchDir:w:\recycler\SCRATCH
call :RunCommand
@echo Elapsed Time is %elapsed%
@echo Image Apply time with Compact and EA is %elapsed% seconds>>%InstallPath%\PerfApply.txt
@echo.
@echo.
@echo *****************************************************************
@echo Copy over Test tools to \TEST_TOOL
@echo \TEST_TOOL SHOULD BE DELETED PRIOR TO SHIPPING
@echo *****************************************************************
call %WinpeSource%Scripts\7zG.exe x %WinpeSource%TEST_TOOL.zip -oW:\
call %WinpeSource%Scripts\7zG.exe x %WinpeSource%OEM.zip -oW:\recovery\OEM\
xcopy %WinpeSource%SNTOOL w:\SNTOOL\ /cherky
xcopy "%WinPESource%TEST_TOOL\*.*" w:\TEST_TOOL\ /cherky
xcopy "%WinPESource%OA30_TOOL\*.*" w:\OA30_TOOL\ /cherky
xcopy "%WinPESource%lcTest\*" w:\Users\user\Desktop\ /cherky
xcopy w:\Recovery\OEM\Scripts\oobe\*.* w:\Windows\System32\oobe\ /s /y
xcopy %WinPESource%OEM\* w:\recovery\OEM\ /s /y
@rem xcopy %WinPESource%images\LayoutModification.xml W:\Users\Default\AppData\Local\Microsoft\Windows\Shell\ /s /y
@rem move r:\recovery\windowsre\winre.wim w:\Windows\System32\recovery\
@echo.
@echo.
@echo.
@echo *****************************************************************
@rem Move WinRE to Recovery Partition
@echo *****************************************************************
@echo.
@echo Modifying attributes of winre.wim so we can move it.
attrib w:\Windows\System32\recovery\winre.wim -s -h -a -r
@echo move w:\Windows\System32\recovery\winre.wim r:\recovery\windowsre
move w:\Windows\System32\recovery\winre.wim r:\recovery\windowsre
if %errorlevel% NEQ 0 echo "Failed to move winre.wim to r:\recovery\windowsre" && goto :error
@echo.
@echo reset attributes now
attrib r:\Recovery\Windowsre\winre.wim +s +h +a +r
@echo.
@echo.
@echo *****************************************************************
@echo Setting the boot environment
@echo *****************************************************************
set command=w:\WINDOWS\SYSTEM32\BCDBOOT 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:\EFI\Recovery
xcopy /e /h S:\EFI\Microsoft\* S:\EFI\Recovery\
del /a S:\EFI\Recovery\Boot\BCD
del /a S:\EFI\Recovery\Boot\BCD.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 \Recovery\WindowsRE\boot.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:]\Recovery\WindowsRE\winre.wim,{11111111-1111-1111-1111-111111111111}
bcdedit /store S:\BCD /set {default} path \Windows\System32\winload.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:]\Recovery\WindowsRE\winre.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:\EFI\Recovery\Boot\
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:\windows\system32\reagentc /SetREImage /Path r:\RECOVERY\WINDOWSRE /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%Scripts\Unattend.xml copy %WinPESource%Scripts\Unattend.xml w:\Windows\Panther /y
if EXIST %WinPESource%Scripts\Unattend.xml copy %WinPESource%Scripts\Unattend.xml w:\Windows\Panther /y
if EXIST %WinPESource%Scripts\RealtimeIsUniversal.reg copy %WinPESource%Scripts\RealtimeIsUniversal.reg w:\recovery\OEM\Scripts\ /y
if EXIST w:\recovery\OEM\Scripts\LayoutModification.xml copy w:\recovery\OEM\Scripts\LayoutModification.xml w:\Users\Default\AppData\Local\Microsoft\Windows\Shell /y
xcopy w:\Recovery\OEM\Backup\*.* w:\Windows\System32\oobe\ /s /y
attrib +s +h +i w:\recovery\
@echo.
@echo.
@echo.
@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=26 tokens=4" %%A in (x:\ParOutput.txt) do (
if /i NOT "%%A"=="Winpe" 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
cd /d w:\windows\system32
call shutdown.exe -s -t 0
@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.
how will I do the installation. will it be direct when I throw commands into it cmd. I WOULD BE GLAD IF YOU WOULD ANSWER. I DON'T KNOW MUCH.
Hi
your laptop boot with windows or the laptop is not boot
yes it do boot and my laptop open windows, but my windows system is not suitable. its have driver problems. I am searching suitable windows system. how I am start that commands you give? How can I do? How can I start where? thanks for your feedback
hi bro
i have the same problem and i live in syria
here there is no way to bay online
can you send me the rom please
this is my whatsapp number
+963997998725
or
0997998725
and this is my email
hsamuldynalazez@gmail.com
please reply me…
re
decompressed the file in usb key
you can choose: boot on usb key and install
or
install with main.cmd
fat32 usb hazırlayın. dosyaları içerisine doğrudan klasörden çıkararak atın. biostan başlangıc usb olarak seçin kendisi otomatik yükleyecektir doğrudan tam sistem çalışır vaziyette yükler imaj kopyasıdır.