Suppose you'd like to have a dvd with Vista/Win7 setup files(installation disk) PLUS ERD Commander, Active Boot Disk, ESET SysRescue, DART 6.x or any other custom made WinPE that you built, on a multiboot CD/DVD, so you could chose which one you'd like to boot.
How do you do it?
Answer: very easy if you know where to look
complete procedure...
Use the default WinVista, WIN 7, WinPE or any bootable wim.
Copy the contents to the HDD
...the structure would be
Code:
dvd1 | - Project Root
| - BOOT (CONTAINS THE BCD FILE TO BE EDITED)
| - EFI
| - SOURCES (CONTAINS THE PE .WIM FILES)
| - OTHER FILES
bcdedit /store bcd /ENUM
This will give you the details of old entry in the boot loader.
You need to note the guid. In every case the default guid is {7619dcc8-fafe-11d9-b411-000476eba25f}
Code:
bcdedit /store bcd /enum
Code:
Windows Boot Manager
--------------------
identifier {bootmgr}
description Windows Boot Manager
locale en-US
inherit {globalsettings}
default {default}
displayorder {default}
toolsdisplayorder {memdiag}
timeout 30
Windows Boot Loader
-------------------
identifier {default}
device ramdisk=[boot]\sources\boot.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
path \windows\system32\boot\winload.exe
description Windows Setup
locale en-US
inherit {bootloadersettings}
osdevice ramdisk=[boot]\sources\boot.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
systemroot \windows
detecthal Yes
winpe Yes
ems Yes
Code:
bcdedit /store bcd /ENUM
Then you copy the default boot entry to a new entry in the bcd store, that has to be updated.
Code:
bcdedit /store bcd /copy {default} /d "Active Boot Disk"
Active Boot Disk is the description I'd like to use for my Active Boot Disk WinPE.
Code:
operation completed successfully.
{613fe2f0-2356-11de-bf6a-001e4cdc40b1}
***{613fe2f0-2356-11de-bf6a-001e4cdc40b1}=new guid
therefore my new guid is {613fe2f0-2356-11de-bf6a-001e4cdc40b1}
now
Code:
bcdedit /store bcd /set {newguid} DEVICE ramdisk=[boot]\sources\boot32.wim,{oldguid}
Code:
operation completed successfully.
Code:
bcdedit /store bcd /set {newguid} OSDEVICE ramdisk=[boot]\sources\boot32.wim,{oldguid}
*** to check whether the bcd store has 2 ramdisks
Code:
bcdedit /store bcd /ENUM
Code:
Windows Boot Manager
--------------------
identifier {bootmgr}
description Windows Boot Manager
locale en-US
inherit {globalsettings}
default {default}
displayorder {default}
{613fe2f0-2356-11de-bf6a-001e4cdc40b1}
toolsdisplayorder {memdiag}
timeout 30
Windows Boot Loader
-------------------
identifier {default}
device ramdisk=[boot]\sources\boot.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
path \windows\system32\boot\winload.exe
description Windows Setup
locale en-US
inherit {bootloadersettings}
osdevice ramdisk=[boot]\sources\boot.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
systemroot \windows
detecthal Yes
winpe Yes
ems Yes
Windows Boot Loader
-------------------
identifier {613fe2f0-2356-11de-bf6a-001e4cdc40b1}
device ramdisk=[boot]\sources\boot32.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
path \windows\system32\boot\winload.exe
description Active Boot Disk
locale en-US
inherit {bootloadersettings}
osdevice ramdisk=[boot]\sources\boot32.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
systemroot \windows
detecthal Yes
winpe Yes
ems Yes
Code:
{7619dcc8-fafe-11d9-b411-000476eba25f}
Copy the boot.wim file in sources folder of active boot disk/ ghost pe/ erdcommander 6.0 to the sources folder in disk1 in the project and rename it to desired. I renamed it to boot32.wim you may use any...(every *.wim must be named differently!)
{default} is not a variable and need not be changed.
Next
This is a script that automates the above process:
Code:
Rem BCD (boot configuration data) editor for multiple WINDOWS 7/Vista PE
REM THIS IS THE ORIGINAL BCD FILE EXTRACTED FROM ANY WINDOWS 7 WINPE / Win 7 / VISTA DVD (I USED Windows 7 INSTALLATION)
set BCD-File="c:\bcd 1\BCD"
REM SET THE NAME FOR THE WINDOWS 7 PE HERE
set pename="Your PE Name"
REM SET THE NAME FOR THE WIM.FILE HERE WITH PATH
set filena=[boot]\sources\yourwimfile.wim
for /f "eol=r tokens=1-2" %%a in ('bcdedit /store %BCD-File% /ENUM all') do set rdo=%%b
for /f "tokens=1-7" %%a in ('Bcdedit /store %BCD-File% /copy {default} /d %pename%') do set guid1=%%g
bcdedit /store %BCD-File% /set %guid1:~0,38% DEVICE ramdisk=%filena%,%rdo%
bcdedit /store %BCD-File% /set %guid1:~0,38% OSDEVICE ramdisk=%filena%,%rdo%
bcdedit /store %BCD-File% /ENUM
remember not to use any spaces in filena variable.
I hope it helps
Thanks to varun037 and Noise from msfn forums.
kukubau aka atolica
No comments:
Post a Comment