|
一般是都是用一个vbs脚来生成BCD的,脚本如下:
Dim WshShell, FSO
Set WshShell = WScript.CreateObject("WScript.Shell")
Set FSO = WScript.CreateObject("Scripting.FileSystemObject")
WSHShell.run "bcdedit /createstore G:\bcd", 0, TRUE
WSHShell.run "Bcdedit /store G:\bcd /create {bootmgr} /d ""Windows Boot Manager""", 0, TRUE
WSHShell.run "Bcdedit /store G:\bcd /set {bootmgr} device boot", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /create {ramdiskoptions}", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /set {ramdiskoptions} ramdisksdidevice boot", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /set {ramdiskoptions} ramdisksdipath \boot\PE\boot.sdi", 0, TRUE
Set getGUID = WshShell.Exec("bcdedit /store G:\bcd /create /d ""Microsoft Windows PE X86"" /application OSLOADER")
Do While getGUID.Status = 0
WScript.Sleep 100
Loop
'Fun little set of code to grep out the GUID
strGUID = getGUID.StdOut.ReadAll
arr1GUID = Split(strGUID, "{")
arr2GUID = Split("{"&arr1GUID(1), "}")
ttrGUID = arr2GUID(0)&"}"
WSHShell.run "bcdedit /store G:\bcd /set "&ttrGUID&" device ramdisk=[boot]\boot\PE\boot32.wim,{ramdiskoptions}", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /set "&ttrGUID&" path \windows\system32\boot\winload.exe", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /set "&ttrGUID&" osdevice ramdisk=[boot]\boot\PE\boot32.wim,{ramdiskoptions}", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /set "&ttrGUID&" systemroot \windows", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /set "&ttrGUID&" winpe yes", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /set "&ttrGUID&" detecthal yes", 0, TRUE
WSHShell.run "Bcdedit /store G:\bcd /set {bootmgr} displayorder "&ttrGUID&" /addfirst", 0, TRUE
WSHShell.run "bcdedit /store G:\bcd /timeout 5", 0, TRUE
这样生成的BCD文件也是12K,修改也方便。
[ 本帖最后由 tdq868xin 于 2009-8-29 12:28 编辑 ] |
|