@echo off rem Erstellung von WinPE-Images und Rauskopieren der benoetigten Dateien rem vgl. Microsoft-TechNet, Walkthrough: Deploy an Image by Using PXE rem Auszufuehren innerhalb der WAIK-Eingabeaufforderung f. Bereitst. rem 20090826-HH Set PXEDest=C:\pxe-tftp Set OSFolder=Boot Set x64wim=winpex64.wim Set x86wim=winpex86.wim Set createx64=true if exist %PXEDest% rmdir %PXEDest% /s /q mkdir %PXEDest% mkdir %PXEDest%\%OSFolder% rem Create WinPE-images if exist %PXEDest%\winpe-x86 rmdir %PXEDest%\winpe-x86 /s /q call copype.cmd x86 %PXEDest%\winpe-x86 if exist %PXEDest%\winpe-x64 rmdir %PXEDest%\winpe-x64 /s /q call copype.cmd amd64 %PXEDest%\winpe-x64 rem Dateien architekturunabhaengig, amd64 hat aber zusaetzlich wdsmgfw.efi imagex /mount %PXEDest%\winpe-x64\winpe.wim 1 %PXEDest%\winpe-x64\mount xcopy %PXEDest%\winpe-x64\mount\Windows\Boot\PXE\* %PXEDest%\%OSFolder% /s /e imagex /unmount %PXEDest%\winpe-x64\mount copy "%ProgramFiles%\Windows AIK\Tools\PETools\x86\boot\boot.sdi" %PXEDest%\%OSFolder% copy %PXEDest%\winpe-x86\winpe.wim %PXEDest%\%OSFolder%\%x86wim% copy %PXEDest%\%OSFolder%\pxeboot.n12 %PXEDest%\%OSFolder%\pxeboot.0 if "%createx64%"=="true" copy %PXEDest%\winpe-x64\winpe.wim %PXEDest%\%OSFolder%\%x64wim% rem BCD-Erstellung fuer PXE-Boot von WAIK-Windows-7 rem vgl. http://www.rrzn.uni-hannover.de/anl-waikpxe.html rem 20100716-HH pushd %PXEDest%\%OSFolder% %systemroot%\system32\bcdedit -createstore BCD %systemroot%\system32\bcdedit -store BCD -create {ramdiskoptions} %systemroot%\system32\bcdedit -store BCD -set {ramdiskoptions} ramdisksdidevice boot %systemroot%\system32\bcdedit -store BCD -set {ramdiskoptions} ramdisksdipath \%OSFolder%\boot.sdi for /f " usebackq delims={} tokens=2" %%i IN (`%systemroot%\system32\bcdedit -store BCD -create /d "WinPE-x86 Boot Image" /application osloader`) do set GUIDx86=%%i if "%createx64%"=="true" for /f " usebackq delims={} tokens=2" %%i IN (`%systemroot%\system32\bcdedit -store BCD -create /d "WinPE-x64 Boot Image" /application osloader`) do set GUIDx64=%%i echo GUID x86: %GUIDx86% if "%createx64%"=="true" echo GUID x64: %GUIDx64% %systemroot%\system32\bcdedit -store BCD -enum echo. %systemroot%\system32\bcdedit -store BCD -set {%GUIDx86%} systemroot \Windows %systemroot%\system32\bcdedit -store BCD -set {%GUIDx86%} detecthal Yes %systemroot%\system32\bcdedit -store BCD -set {%GUIDx86%} winpe Yes %systemroot%\system32\bcdedit -store BCD -set {%GUIDx86%} osdevice ramdisk=[boot]\%OSFolder%\%x86wim% %systemroot%\system32\bcdedit -store BCD -set {%GUIDx86%} device ramdisk=[boot]\%OSFolder%\%x86wim%,{ramdiskoptions} if "%createx64%"=="true" %systemroot%\system32\bcdedit -store BCD -set {%GUIDx64%} systemroot \Windows if "%createx64%"=="true" %systemroot%\system32\bcdedit -store BCD -set {%GUIDx64%} detecthal Yes if "%createx64%"=="true" %systemroot%\system32\bcdedit -store BCD -set {%GUIDx64%} winpe Yes if "%createx64%"=="true" %systemroot%\system32\bcdedit -store BCD -set {%GUIDx64%} osdevice ramdisk=[boot]\%OSFolder%\%x64wim% if "%createx64%"=="true" %systemroot%\system32\bcdedit -store BCD -set {%GUIDx64%} device ramdisk=[boot]\%OSFolder%\%x64wim%,{ramdiskoptions} %systemroot%\system32\bcdedit -store BCD -create {bootmgr} /d "WinPE BootManager" %systemroot%\system32\bcdedit -store BCD -timeout 30 %systemroot%\system32\bcdedit -store BCD -default {%GUIDx86%} if not "%createx64%"=="true" %systemroot%\system32\bcdedit -store BCD -displayorder {%GUIDx86%} if "%createx64%"=="true" %systemroot%\system32\bcdedit -store BCD -displayorder {%GUIDx86%} {%GUIDx64%} popd goto end :end echo. echo. echo. echo Transfer the "%OSFolder%" folder from %PXEDest%\ to the tftp-root folder of your PXE-Server. pause