IPB

Google Frontpage Forums Unattended CD/DVD Guide
 Forum Rules Unattended CD/DVD Guide Homepage · MSFN Forum Rules
 
Reply to this topicStart new topic
> Adding XP to BCD, Windows RE too!!!!
TheReasonIFail
post Mar 27 2008, 05:22 PM
Post #1


Member
**

Group: Members
Posts: 105
Joined: 8-April 07
From: Berwyn, Illinois
Member No.: 134809
OS: XP Pro x86
Country Flag


OK,

I'm trying to setup BCD to show WinPE and WinXP. Things aren't working too well.

Here is the script I'm currently using.

To me it seems that when I add the entry for XP, it overwrites the PE entry.

Any and all help is appreciated.

CODE
@ECHO OFF
SET CD=D:
SET PHD=W:
SET XHD=C:
DISKPART -S DEFAULTPART.TXT
imagex /apply %CD%\sources\boot.wim 1 %PHD%
imagex /apply winxp.wim 1 %XHD%
xcopy %CD%\boot\*.* /e /f %PHD%\boot\
copy %CD%\bootmgr %PHD%
del %PHD%\boot\bcd
Bcdedit -createstore %PHD%\boot\BCD
Bcdedit -store %PHD%\boot\BCD -create {bootmgr} /d "Boot Manager"
Bcdedit -store %PHD%\boot\BCD -set {bootmgr} device boot
Bcdedit -store %PHD%\boot\BCD -create  /d "WINPE" -application osloader
notepad winpeinst.bat
Bcdedit -store %PHD%\boot\BCD -set <GUID> osdevice partition=%PHD%
Bcdedit -store %PHD%\boot\BCD -set <GUID> device partition=%PHD%
Bcdedit -store %PHD%\boot\BCD -set <GUID> path \windows\system32\boot\winload.exe
Bcdedit -store %PHD%\boot\BCD -set <GUID> systemroot \windows
Bcdedit -store %PHD%\boot\BCD -set <GUID> winpe yes
Bcdedit -store %PHD%\boot\BCD -set <GUID> detecthal yes
Bcdedit -store %PHD%\boot\BCD -CREATE {LEGACY} /D "Windows XP"
Bcdedit -store %PHD%\boot\BCD -SET {LEGACY} DEVICE BOOT
Bcdedit -store %PHD%\boot\BCD -SET {LEGACY} PATH \NTLDR
Bcdedit -store %PHD%\boot\BCD -DISPLAYORDER {LEGACY} -ADDLAST


This post has been edited by TheReasonIFail: Mar 29 2008, 12:58 PM
Go to the top of the page
 
+Quote Post
TheReasonIFail
post Mar 27 2008, 07:49 PM
Post #2


Member
**

Group: Members
Posts: 105
Joined: 8-April 07
From: Berwyn, Illinois
Member No.: 134809
OS: XP Pro x86
Country Flag


All right, after some playing I've edited to:

CODE
@ECHO OFF
SET CD=D:
SET PHD=W:
SET XHD=C:
DISKPART -S DEFAULTPART.TXT
imagex /apply %CD%\sources\boot.wim 1 %PHD%
imagex /apply winxp.wim 1 %XHD%
xcopy %CD%\boot\*.* /e /f %PHD%\boot\
copy %CD%\bootmgr %PHD%
del %PHD%\boot\bcd
Bcdedit -createstore %PHD%\boot\BCD
Bcdedit -store %PHD%\boot\BCD -create {bootmgr} /d "Boot Manager"
Bcdedit -store %PHD%\boot\BCD -set {bootmgr} device boot
Bcdedit -store %PHD%\boot\BCD -CREATE {NTLDR} /D "Windows XP"
Bcdedit -store %PHD%\boot\BCD -set {NTLDR} DEVICE PARTITION=%XHD%
Bcdedit -store %PHD%\boot\BCD -set {NTLDR} PATH \NTLDR
Bcdedit -store %PHD%\boot\BCD -create /D "Windows PE" -APPLICATION OSLOADER
notepad winpeinst.bat
Bcdedit -store %PHD%\boot\BCD -set <GUID> osdevice partition=%PHD%
Bcdedit -store %PHD%\boot\BCD -set <GUID> device partition=%PHD%
Bcdedit -store %PHD%\boot\BCD -set <GUID> path \windows\system32\boot\winload.exe
Bcdedit -store %PHD%\boot\BCD -set <GUID> systemroot \windows
Bcdedit -store %PHD%\boot\BCD -set <GUID> winpe yes
Bcdedit -store %PHD%\boot\BCD -set <GUID> detecthal yes
Bcdedit -store %PHD%\boot\BCD -DISPLAYORDER {NTLDR} <GUID>
Bcdedit -store %PHD%\boot\BCD -DEFAULT {NTLDR}
Bcdedit -store %PHD%\boot\BCD -TIMEOUT 2


Now I get prompted for each entry, but choosing Windows XP, gives me the following error:

File: \NTLDR
Status: 0xc000000d
Info: The selected entry could not be loaded because the application is missing or corrupt.

This post has been edited by TheReasonIFail: Mar 27 2008, 08:01 PM
Go to the top of the page
 
+Quote Post
WreX
post Mar 28 2008, 07:50 AM
Post #3


Junior
*

Group: Members
Posts: 56
Joined: 26-October 07
Member No.: 159852
OS: none
Country Flag


My first comment is to be sure you have the NTLDR files (NTLDR, NTDETECT.COM, and boot.ini) in the root of the primary active partition (probably C:). My second is that you have "{ntldr} device partition=" and I think it should be "{ntldr} device boot". Here's my batch file for booting a PE WIM on C: into RAM and NTLDR:
CODE
xcopy %CDROM%\BOOT\*.* /e /f /y C:\BOOT\
copy %CDROM%\BOOTMGR C:\
copy %CDROM%\SOURCES\BOOT.WIM C:\BOOT\BOOT.WIM
IF EXIST C:\BOOT\BCD DEL C:\BOOT\BCD
IF NOT EXIST C:\TEMP MD C:\TEMP
IF EXIST C:\TEMP\BCD DEL C:\TEMP\BCD
bcdedit -createstore C:\TEMP\BCD
bcdedit -store C:\TEMP\BCD -create {bootmgr} /d "Boot Manager"
bcdedit -store C:\TEMP\BCD -set {bootmgr} device boot
bcdedit -store C:\TEMP\BCD -create {ramdiskoptions} /d "WinPE"
bcdedit -import C:\TEMP\BCD
bcdedit -set {ramdiskoptions} ramdisksdidevice partition=C:
bcdedit -set {ramdiskoptions} ramdisksdipath \BOOT\BOOT.sdi
for /f "tokens=3" %%a in ('bcdedit -create /d "WinPE" -application osloader') do set guid=%%a
bcdedit -set %guid% device ramdisk=[C:]\BOOT\BOOT.WIM,{ramdiskoptions}
bcdedit -set %guid% path \WINDOWS\SYSTEM32\BOOT\WINLOAD.EXE
bcdedit -set %guid% osdevice ramdisk=[C:]\BOOT\BOOT.WIM,{ramdiskoptions}
bcdedit -set %guid% systemroot \WINDOWS
bcdedit -set %guid% winpe yes
bcdedit -set %guid% detecthal yes
bcdedit -displayorder %guid% -addlast
bcdedit -create {ntldr} /d "Microsoft Windows XP"
bcdedit -set {ntldr} device boot
bcdedit -set {ntldr} path \ntldr
bcdedit -displayorder {ntldr} -addfirst
bcdedit -default {ntldr}
bcdedit -timeout 5
bootsect /nt60 C:
Go to the top of the page
 
+Quote Post
TheReasonIFail
post Mar 29 2008, 12:30 PM
Post #4


Member
**

Group: Members
Posts: 105
Joined: 8-April 07
From: Berwyn, Illinois
Member No.: 134809
OS: XP Pro x86
Country Flag


SUCCESS!!!

I've finally gotten Windows RE to work with XP and here is the script I used:

CODE
@ECHO OFF
SET CD=D:
SET PHD=E:
SET XHD=C:
SET REGUID=572bcd55-ffa7-11d9-aae0-0007e994107d
REGEDIT -S VDS.REG
DISKPART -S PREPART.TXT
BOOTSECT.EXE /NT60 All
imagex /apply winre.wim 1 %PHD%
COPY WINXP.WIM %PHD%\Sources\Recovery\*.*
IMAGEX /APPLY %PHD%\Sources\Recovery\WINXP.WIM 1 %XHD%
xcopy %CD%\boot\*.* /e /f %XHD%\boot\
copy %CD%\bootmgr %XHD%
del %XHD%\BOOT\BCD
Bcdedit -CREATESTORE %XHD%\BOOT\BCD
BCDEDIT -STORE %XHD%\BOOT\BCD -create {BOOTMGR} /d "Boot Manager"
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {BOOTMGR} DEVICE BOOT
BCDEDIT -STORE %XHD%\BOOT\BCD -CREATE {NTLDR} /D "Windows XP"
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {NTLDR} DEVICE BOOT
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {NTLDR} PATH \NTLDR
BCDEDIT -STORE %XHD%\BOOT\BCD -create {%REGUID%} /D "Windows Recovery Environment" -APPLICATION OSLOADER
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} osdevice partition=%PHD%
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} device partition=%PHD%
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} path \windows\system32\boot\winload.exe
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} systemroot \windows
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} winpe yes
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} detecthal yes
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} nx optin
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} custom:46000010 yes
BCDEDIT -STORE %XHD%\BOOT\BCD -DEFAULT {NTLDR}
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {DEFAULT} RECOVERYSEQUENCE {%REGUID%}
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {DEFAULT} RECOVERYENABLED YES
BCDEDIT -STORE %XHD%\BOOT\BCD -DISPLAYORDER {NTLDR} {%REGUID%}
REM BCDEDIT -STORE %XHD%\BOOT\BCD -TIMEOUT 2
ATTRIB +R +H +S %XHD%\BOOTMGR
ATTRIB +R +H +S %XHD%\BOOT\


and here are the command in prepart.txt

CODE
SELECT DISK 0
CLEAN
CREATE PARTITION PRIMARY SIZE=4096
ASSIGN LETTER=E:
FORMAT FS=NTFS QUICK LABEL="Windows RE"
SET ID=27
CREATE PARTITION PRIMARY
ASSIGN LETTER=C:
ACTIVE
FORMAT FS=NTFS QUICK LABEL="Windows XP"
SET ID=07


This post has been edited by TheReasonIFail: Mar 29 2008, 12:58 PM
Go to the top of the page
 
+Quote Post
neo
post Mar 30 2008, 12:03 PM
Post #5


Microsoft® MVP
******

Group: Members
Posts: 1308
Joined: 31-March 06
From: India
Member No.: 92414
OS: Vista Ultimate x86
Country Flag


Thats gr8....
Go to the top of the page
 
+Quote Post
TheReasonIFail
post Apr 1 2008, 01:43 PM
Post #6


Member
**

Group: Members
Posts: 105
Joined: 8-April 07
From: Berwyn, Illinois
Member No.: 134809
OS: XP Pro x86
Country Flag


Well, it seems that sysprep is screwing with the BCD.

I've edited the file to be a two part install so WinPE is installed after sysprep has run on the C: drive.

I'm going to work on that today. Hopefully that will work for now.

CODE
@ECHO OFF
SET CD=D:
SET PHD=W:
SET XHD=C:
SET REGUID=572BCD55-FFA7-11D9-AAE0-0007E994107D

GOTO MENU
:MENU
ECHO.
ECHO What would you like to do?
ECHO (Press Number followed by Enter key.)
ECHO.
ECHO 1. Format  and image disk with Windows XP Professional
ECHO 2. Install Windows Recovery Environment
ECHO 3. Open A43 File Manager
ECHO 4. Quit and reboot PC
ECHO.

:CHOICE
SET /P C=[1,2,3,4,5,6,7]?
IF "%C%"=="4" GOTO QUIT
IF "%C%"=="3" GOTO A43
IF "%C%"=="2" GOTO WINRE
IF "%C%"=="1" GOTO WINXP
GOTO CHOICE

:WINXP
ECHO Preparing Disk for Windows Installation
ECHO After imaging is complete, let sysprep complete before creating recovery partition
DISKPART -S DP\PREPART.TXT
REGEDIT -S VDS.REG
IMAGEX /APPLY WIM\XP_SYSPREP.WIM 1 %XHD%
START /WAIT WSCRIPT WIMHALDETECT.VBS
WPEUTIL REBOOT

:WINRE
ECHO
BOOTSECT.EXE /NT60 ALL
IMAGEX /APPLY WIM\WINRE.WIM 1 %PHD%
COPY FILES\*.* %XHD%\WINDOWS\SYSTEM32\
XCOPY %CD%\BOOT\*.* /e /f %XHD%\BOOT\
COPY %CD%\BOOTMGR %XHD%
DEL %XHD%\BOOT\BCD
BCDEDIT -CREATESTORE %XHD%\BOOT\BCD
BCDEDIT -STORE %XHD%\BOOT\BCD -create {BOOTMGR} /d "Boot Manager"
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {BOOTMGR} DEVICE BOOT
BCDEDIT -STORE %XHD%\BOOT\BCD -CREATE {NTLDR} /D "Windows XP"
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {NTLDR} DEVICE BOOT
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {NTLDR} PATH \NTLDR
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {NTLDR} LOCALE EN-US
BCDEDIT -STORE %XHD%\BOOT\BCD -create {%REGUID%} /D "Backup and Restore" -APPLICATION OSLOADER
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} OSDEVICE PARTITION=%PHD%
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} DEVICE PARTITION=%PHD%
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} path \windows\system32\boot\winload.exe
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} systemroot \windows
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} winpe yes
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} detecthal yes
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} nx optin
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} custom:46000010 yes
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {%REGUID%} LOCALE EN-US
BCDEDIT -STORE %XHD%\BOOT\BCD -DEFAULT {NTLDR}
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {DEFAULT} RECOVERYSEQUENCE {%REGUID%}
BCDEDIT -STORE %XHD%\BOOT\BCD -SET {DEFAULT} RECOVERYENABLED YES
BCDEDIT -STORE %XHD%\BOOT\BCD -DISPLAYORDER {NTLDR} {%REGUID%}
BCDEDIT -STORE %XHD%\BOOT\BCD -TIMEOUT 0
DISKPART -S DP\POST.TXT
WPEUTIL REBOOT

:A43
A43.EXE

:QUIT
WPEUTIL REBOOT


I'm using the old choice.com file to get the prompts. Is there a way to do that with some more recent "technology"?

This post has been edited by TheReasonIFail: Apr 1 2008, 01:46 PM
Go to the top of the page
 
+Quote Post
TheReasonIFail
post Jun 5 2008, 11:22 AM
Post #7


Member
**

Group: Members
Posts: 105
Joined: 8-April 07
From: Berwyn, Illinois
Member No.: 134809
OS: XP Pro x86
Country Flag


Well, I finally got it working!

I first set the WinPE partition as being active, creating the BCD and moved the XP boot files to the PE partition. Now sysprep doesn't touch the BCD and we now have a fully functional machine with PE and XP.

It never dawned on me that I should move the boot files from the XP partition to the PE partition.

Yay!

Here is what the new script looks like:

CODE
@ECHO OFF
SET CD=D:
SET RECVY=W:
SET WINXP=C:
SET REGUID=572BCD55-FFA7-11D9-AAE0-0007E994107D
REGEDIT -S VDS.REG
DISKPART -S PREPART.TXT
BOOTSECT.EXE /NT60 %RECVY%
BOOTSECT.EXE /NT52 %WINXP%
IMAGEX /APPLY BOOT.WIM 1 %RECVY%
IMAGEX /APPLY WINXPSP3.WIM 1 %WINXP%
START /WAIT WSCRIPT WIMHALDETECT.VBS
ATTRIB -R -H -S %WINXP%\NTLDR
ATTRIB -R -H -S %WINXP%\NTDETECT.COM
ATTRIB -R -H -S %WINXP%\BOOT.INI
COPY %WINXP%\NTLDR %RECVY%\
COPY %WINXP%\NTDETECT.COM %RECVY%\
COPY %WINXP%\BOOT.INI %RECVY%\
ATTRIB +R +H +S %RECVY%\NTLDR
ATTRIB +R +H +S %RECVY%\NTDETECT.COM
ATTRIB +R +H +S %RECVY%\BOOT.INI
DEL %WINXP%\NTLDR
DEL %WINXP%\NTDETECT.COM
DEL %WINXP%\BOOT.INI
MD %RECVY%\BOOT\
XCOPY %CD%\BOOT\*.* /E /F %RECVY%\BOOT\
COPY %CD%\BOOTMGR %RECVY%
DEL %RECVY%\BOOT\BCD
BCDEDIT -CREATESTORE %RECVY%\BOOT\BCD
BCDEDIT -STORE %RECVY%\BOOT\BCD -create {BOOTMGR} /d "Boot Manager"
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {BOOTMGR} DEVICE BOOT
BCDEDIT -STORE %RECVY%\BOOT\BCD -CREATE {NTLDR} /D "Windows XP"
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {NTLDR} DEVICE PARTITION=%WINXP%
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {NTLDR} PATH \ntldr
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {NTLDR} LOCALE EN-US
BCDEDIT -STORE %RECVY%\BOOT\BCD -create {%REGUID%} /D "Backup and Restore" -APPLICATION OSLOADER
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} OSDEVICE BOOT
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} DEVICE BOOT
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} PATH \windows\system32\boot\winload.exe
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} SYSTEMROOT \Windows
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} WINPE YES
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} DETECTHAL YES
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} NX OPTIN
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} CUSTOM:46000010 YES
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {%REGUID%} LOCALE EN-US
BCDEDIT -STORE %RECVY%\BOOT\BCD -DEFAULT {NTLDR}
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {DEFAULT} RECOVERYSEQUENCE {%REGUID%}
BCDEDIT -STORE %RECVY%\BOOT\BCD -SET {DEFAULT} RECOVERYENABLED YES
BCDEDIT -STORE %RECVY%\BOOT\BCD -DISPLAYORDER {NTLDR} {%REGUID%}
BCDEDIT -STORE %RECVY%\BOOT\BCD -TIMEOUT 2
WPEUTIL REBOOT


Instead of manually moving the XP bootfiles, I just added it to the script.

This post has been edited by TheReasonIFail: Jun 5 2008, 03:08 PM
Go to the top of the page
 
+Quote Post

Google Frontpage Forums Unattended CD/DVD Guide

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 8th January 2009 - 03:21 AM
All trademarks mentioned on this page are the property of their respective owners
MSFN is not affiliated with Microsoft
Copyright © 2001-2008 msfn.org
Privacy Policy