Jump to content











Photo
- - - - -

Change path from (BOOTMGR -> \Boot\BCD) to (WIM9MGR -> \Boot\WIM) / (WIM9MGR -> \WIM)

bootmgr bcd boot zbootmgr

  • Please log in to reply
48 replies to this topic

#1 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 July 2014 - 03:48 AM

Hello Everyone....

 

Some time ago I had found a 'USB.zip' from http://windowsforum.kr/review/5665807 . But this link is currently not working. Within 'USB.zip' I have found following files which are looking modified version of BOOTMGR and BCD.

 

BDF7MBR  ->  \Boot\BDF

BIS7MGR    ->  \Boot\BIS

BTP7MGR  ->  \Boot\BTP

INSTMGR   ->  \Boot\BCD

 

index.php?app=core&module=attach&section

 

I want to modify 'BOOTMGR' and 'BCD' as follows. But I don't know how to do this ?

-------------------------------------------------------------------------------------------------------------------

(BOOTMGR -> \Boot\BCD) to (WIM9MGR -> \Boot\WIM) / (WIM9MGR -> \WIM)

 

(BOOTMGR -> \Boot\BCD) to (VHDXMGR -> \Boot\VHD) / (VHDXMGR -> \VHD) 

-------------------------------------------------------------------------------------------------------------------

If anybody know about how to modify 'BOOTMGR' and 'BCD' in above fashion then please help me........
 
Note- I know I can create (bootmgr1 ,bootmgr2 , bootmgr3....) and (bc1, bc2 ,bc3....) by using 'zbootmgr.exe' . but I want a method/tool other than 'zbootmgr.exe'.
 
Thanks in Advance
 
Regards.....

 

USB.zip Contents.png



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2014 - 01:21 PM

And the idea of searching a bit didn't cross your mind, right?

 

Here:

http://reboot.pro/to...r-of-windows-8/

http://reboot.pro/fi...ls-bootmgrntfs/

 

Which BTW were already provided to you here some time ago:

http://reboot.pro/to...otmgr-boot-bcd/

 

 

So we are back to the "I don't understand" (or "I don't want to understand") previous art, for some reasons I want to do it differently, I don't care about any limitation that is impossible to overcome, and since I cannot do it, someone else should do it for me? :dubbio:

 

:duff:

Wonko



#3 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 July 2014 - 02:37 PM

@wonko

 

You mean I have to use 'LZNT1_Tools' in order to change file path of bootmgr (boot \ BCD) ?

 

If 'Yes' , then I am unable to understand the procedure for changing file path of bootmgr with the help of 'LZNT1_Tools' ?

 

If you don't mind then Can you please provide me some simple step by step procedure instead of just sharing lengthy and complex links again and again.

 

Instead of sharing long confusing posts please tell me about the exact tools/procedure in order to change file path of bootmgr.

 

Currently I am using 'zbootmgr.exe' for this purpose but 'zbootmgr.exe' have some limitations. It's why I want alternative simple tool/method which will allow me to choose desired name for 'bootmgr' and 'bcd'.

 

Thanks in Advance



#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2014 - 03:01 PM

The "generic" process is:

  1. uncompress the BOOTMGR
  2. change whatever you want in it <- this assumes more than basic knowledge about using a hex editor and some experimenting
  3. make sure to change the checksum or disable the the check
  4. recompress it

What the given resources may provide you with are #1, #3 and #4, what you do in #2 (and whether it will work or not) is entirely up to you.

 

Which EXACT limitation(s) did you find in zbootmgr.exe?

What is the REASON of this(these) limitations(s)?

WHY would other methods be needed IF there were not such limitations?

WHY yet other methods may be needed to work around further limitations of these other methods?

WHAT IF some of the "limitations" of a given method are not actually a "limitation" but actually something "impossible"?

Did you manage to understand that each SPECIFIC, EXACT, version of BOOTMGR (the piece of info you completely failed to provide) may need one or the other method (or possibly a suitable method does not even exist)?

 

Don't bother to reply to the above questions, they were made only for rhetorical purposes. :whistling:

 

You could restart from here:

http://reboot.pro/to...e-bootmgr-file/

By providing the info asked here:

http://reboot.pro/to...-file/?p=148420

AND read this (link provided in the above thread):

http://reboot.pro/to...ffset-question/

 

and at least TRY to read and understand the provided resources, though we are still in the original situation, you want to do something "extremely advanced" (IMHO also without a logical reason) without having the needed "extremely advanced" knowledge of the mechanisms involved.

 

:duff:

Wonko



#5 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 July 2014 - 03:23 PM

'zbootmgr.exe' does not allow me to choose desired name for 'BCD' (i.e. WIM, VHD etc...).  'zbootmgr.exe' also does not allow me to change file path of 'BOOTMGR' from \Boot\BCD to \WIM or \VHD .

 

You mean there is no other solution other than 'generic' process in order to change file path of 'BOOTMGR' from

 \Boot\BCD to \WIM or \VHD ?

 

You mean the modified 'BOOTMGR' files ( BDF7MBR , BIS7MGR , BTP7MGR  , INSTMGR) which I have were modified with the help of 'generic' process ?

 

Regards.......



#6 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 27 July 2014 - 04:09 PM

Why do you like to change bootmgr at all?

How do you use different bootmgr? Do you chainload at grub4dos?

What about one bootmgr?
-different bcd files, dd one at boot
-or patch bcd in RAM

#7 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2014 - 04:10 PM

'zbootmgr.exe' does not allow me to choose desired name for 'BCD' (i.e. WIM, VHD etc...). 'zbootmgr.exe' also does not allow me to change file path of 'BOOTMGR' from \Boot\BCD to \WIM \VHD .

Really? :w00t:
That is an issue. :dubbio:
The fact that ADDITIONALLY it won't work for a non-Vista-SP0 or non-WAIK-for-7-version of the BOOTMGR file is probably a trifling detail?
Really finding this piece of info in the provided link is not that much work:
http://reboot.pro/to...e-bootmgr-file/
See if this (complementary to the already given links) helps:
http://www.msfn.org/...at-kind-of-bcd/

 

You mean there is no other solution other than 'generic' process in order to change file path of 'BOOTMGR' from
 \Boot\BCD to \WIM or \VHD ?

No, I mean that "by definition" the "generic process" is "generic" and applies "generically" to ALL possible methods of modifying a compressed BOOTMGR, AND I also mean that changing \Boot\BCD to \WIM may also NOT be possible at all without some serious work of decompiling and recompiling the BOOTMGR.
The alternative, as seen, may be to patch the BCD or BOOTMGR in RAM, but still the patch needs to be devised.


 

You mean the modified 'BOOTMGR' files ( BDF7MBR , [/size][/size]BIS7MGR , [/size]BTP7MGR  , [/size]INSTMGR[/size]) which I have were modified with the help of 'generic' process ?

No, I have NO idea how the files you have, and that you got "from somewhere on the internet", were modified, but again, by definition a "generic" process is "generic".
Now since you have the files and were given some (good :unsure:) hints on the tools that might be used to inspect them, I quess you should be able find your answers yourself.


:duff:
Wonko


  • devdevadev likes this

#8 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 July 2014 - 04:39 PM

Why do you like to change bootmgr at all?

How do you use different bootmgr? Do you chainload at grub4dos?

What about one bootmgr?
-different bcd files, dd one at boot
-or patch bcd in RAM

 

Yes, I use different bootmgr in order to chainload at grub4dos. I know I can use one bootmgr and add multiple boot entries in 'BCD' but it increase number of selection in order to boot WIM, VHD etc....

 

Currently I am using three different 'bootmgr' for 'Win 8.1 U1_Installer' , 'WIMBoot.vhdx' and 'Win8.1U1SE_x64_boot.wim' in order to chainload at grub4dos (E2B). I don't prefer one 'bootmgr' because I do not want to see 'Boot Manager' screen in order to select entries. I want to select entries within form Easy2boot menu.

 

Actually there is no problem/issue with 'zbootmgr.exe'. It just work perfectly for me. But it would be more better if I learn a simple method in order to change file path of BOOTMGR from '\Boot\BCD) to \Boot\WIM ?

 

Regards



#9 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2014 - 04:51 PM

Can you understand the simple notion that changing the filename \boot\BCD to filename \boot\WIM is one thing and that changing BOTH filename AND path from \boot\BCD to \WIM are two VERY DIFFERENT things?

What do you think that the info given here (by cdob :worship:) is about?
http://www.msfn.org/...at-kind-of-bcd/

 

 

:duff:

Wonko



#10 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 July 2014 - 05:19 PM


Can you understand the simple notion that changing the filename \boot\BCD to filename \boot\WIM is one thing and that changing BOTH filename AND path from \boot\BCD to \WIM are two VERY DIFFERENT things?

 

Yes, I can understand that both are two different things. BTW changing filename \boot\BCD to filename \boot\WIM does not make any sense without changing file path of BOOTMGR.

 

Actually changing file path of BOOTMGR from '\Boot\BCD) to \Boot\WIM "  already indicating for changing BOTH file name AND path from \boot\BCD to \boot\WIM . Word 'WIM' clearly express that I am also talking about changing file name along with changing file path of BOOTMGR. 

 

I think both \Boot\BCD and \Boot\WIM are not just two different file names but also two different file path of 'BOOTMGR' . Am I wrong ?

 

Regards......



#11 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 July 2014 - 05:52 PM

No, no, no. :frusty:

 

You completely failed to READ this topic (to which you were pointed some time ago, here: http://reboot.pro/to...t-bcd/?p=185192 ) :

http://reboot.pro/to...usb-sub-folder/

ALL of it.

 

I will try to tell you this in simpler words.

 

There are NO particular issues in changing the NAME of the BCD store from "BCD" to ANY other NAME as long as the new NAME is still three characters long, but you might need, depending on the exact specific version of BOOTMGR, to workaround some compression/checksums/integrity checks.

 

The PATH to the BCD store, which is hardcoded to "\boot\" cannot AFAIK be changed (or changed as easily)

 

If you are going to use a single BOOTMGR file, changing on the fly the NAME (and not the path) of the file \boot\BCD to \boot\WIM can be done with grub4dos.

 

But, if you are determined to use several different BOOTMGR files (i.e. you are OK with the space these several copies need), it makes no real sense to modify at all any of them or to rename them, as it is IMNSHO easier, faster and more convenient to use INSTEAD a set of floppy images, as said in the mentioned thread, starting from here:

http://reboot.pro/to...folder/?p=73358

 

And you could even use a COSMIAS approach :w00t: (shameless plug ;)):

http://reboot.pro/to...-to-g4d-images/

but until you do not try (and succeed) to understand the basics it won't help you much. :(

 

:duff:

Wonko


  • devdevadev likes this

#12 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 27 July 2014 - 06:04 PM

changing filename \boot\BCD to filename \boot\WIM does not make any sense without changing file path of BOOTMGR.

dd one at boot

grub4dos can copy files, dd is one possibility,
You use this approach already: AutoUnattend.xml

With the same approach
\bootmgr
\boot\bcd
\boot\bcd.01
\boot\bcd.02

At menu.lst dd \boot\bcd.01 to \boot\bcd.
 

I know I can use one bootmgr and add multiple boot entries in 'BCD' but it increase number of selection in order to boot WIM, VHD etc...

Edit \boot\bcd at grub4dos, change default entry.
This dosn't increase number of selection in order to boot.


There are floppy images too. That's another story.

In my opinion: do not edit bootmgr, especial since Windows 8 bootmgr.
Search another work around.
  • devdevadev likes this

#13 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 July 2014 - 07:02 PM

cdob, on 27 Jul 2014 - 11:34 PM, said:

Search another work around.


the oven . org / index.php?topic=530.msg8154

Here is a script created by HALIKUS that will make a custom BCD File from scratch, or add to the systems bcd. It works for both efi and mbr. Just rem out the things you want or dont want in :DVDMBR, :HDDMBR, :DVDEFI, and :HDDEFI and change any paths that differ.
@echo off
rem http://diddy.boot-land.net/bcdedit/files/examples1.htm#winpe
rem for VMWARE   firmware= "efi"
title Windows V 7 8 install.wim boot.wim and BCD manipulation
:checkPrivileges 
NET FILE 1&gt;NUL 2&gt;NUL
if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges ) 
:getprivileges 
if '%1'=='ELEV' (shift &amp; goto gotPrivileges)  
setlocal DisableDelayedExpansion
set "batchPath=%~0"
setlocal EnableDelayedExpansion
ECHO set UAC = CreateObject^("Shell.Application"^) &gt; "%temp%\OEgetPrivileges.vbs" 
ECHO UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 &gt;&gt; "%temp%\OEgetPrivileges.vbs" 
"%temp%\OEgetPrivileges.vbs" 
exit /B 
:gotPrivileges 

:STARTBCD

REM :::Choose variables here and below for :DVDMBR, :HDDMBR, :DVDEFI, and :HDDEFI
set BCD=%~dp0BCD
Set BCDEDIT=%SYSTEMROOT%\System32\BCDEDIT.exe
REM partition letter is the drive where your files you want to boot are.  For DVD, "boot" is used.
set PartitionLetter=D:

title Choose desired BCD 
cls
echo.
echo.
echo        Choose BCD type... 
echo.          
echo. 
echo   1 = DVD MBR (%BCD%) (Make custom BCD file)
echo.
echo   2 = HDD MBR (System) (Add entries to your system BCD)
echo. 
echo   3 = DVD EFI (%BCD%) (Make custom BCD file)
echo.
echo   4 = HDD EFI (System) (Add entries to your system BCD)
echo. 
echo   5 = DELETE Entry
echo   6 = RENAME BCD 
echo   7 = Change ORDER of BCD
echo   8 = Add Specific Entry to BCD
echo   9 = Add Win8 Safemode to system BCD (Must be logged in to Win8)
echo   10 = Boot Legacy (Win7)
echo   11 = Boot Standard (Win8)
echo   12 = Choose Deafult boot entry
echo.
echo   ** HDD Wim and VHD files Partition = %PartitionLetter%
echo.
echo. 
SET /P IM=Input number : 
SET DD=
If "%IM%"=="1" goto :DVDMBR
If "%IM%"=="2" goto :HDDMBR
If "%IM%"=="3" goto :DVDEFI
If "%IM%"=="4" goto :HDDEFI
If "%IM%"=="5" goto :DeleteBCD
If "%IM%"=="6" goto :RenameBCD
If "%IM%"=="7" goto :OrderBCD
If "%IM%"=="8" goto :AddBCD 
If "%IM%"=="9" goto :Win8Safemode
If "%IM%"=="10" goto :BootLegacy
If "%IM%"=="11" goto :BootStandard
If "%IM%"=="12" goto :DefaultBCD
If "%DD%"=="" echo INVALID NUMBER
If "%DD%"=="" goto :STARTBCD


:DVDMBR
rem echo f | xcopy ISO_2 bcd
rem set BCD=%~dp0BCD
set STORE=/store %BCD%
rem %BCDEDIT% /createstore %BCD%
set PartitionLetter=boot
set Partition=boot
set Path=[boot]\sources
set PathXPWIM=[boot]\boot
REM choice is for efi, leave blank for mbr
set choice=
set applicationpath=\Windows\system32\boot\winload.exe
set applicationpathHDD=\Windows\system32\winload.exe
set VHDname=VHD.vhd
rem set ramdisksdipath=\boot\boot.sdi
set bootmenupolicy=standard
set DisplayBootMenu=%BCDEDIT% %STORE% /set {bootmgr} DisplayBootMenu True
set memtest=\boot\memtest.exe
goto :CREATECUSTOMDVD%choice%


:HDDMBR
set STORE=
rem set PartitionLetter=d:
set Partition=Partition=%PartitionLetter%
set Path=[%PartitionLetter%]\sources
REM choice is for efi, leave blank for mbr
set choice=
set applicationpath=\Windows\system32\winload.exe
set applicationpathHDD=\Windows\system32\winload.exe
set VHDname=VHD.vhd
rem ?
rem set ramdisksdipath=\Windows\system32\boot.sdi
set DisplayBootMenu=%BCDEDIT% %STORE% /set {bootmgr} DisplayBootMenu False
set memtest=\Windows\Boot\PCAT\memtest.exe
%BCDEDIT% /set {current} bootmenupolicy standard
goto :CREATECUSTOMHDD%choice%



:DVDEFI
set STORE=/store %BCD%
set PartitionLetter=boot
set Partition=boot
set Path=[boot]\sources
REM choice is for efi, leave blank for mbr
set choice=EFI
set applicationpath=\Windows\system32\boot\winload.efi
set applicationpathHDD=\Windows\system32\winload.efi
set VHDname=VHD.vhd
set bootmenupolicy=standard
rem set ramdisksdipath=\boot\boot.sdi
set DisplayBootMenu=%BCDEDIT% %STORE% /set {bootmgr} DisplayBootMenu True
set memtest=\efi\microsoft\boot\memtest.efi
goto :CREATECUSTOMDVD%choice%



:HDDEFI
set STORE=
rem set PartitionLetter=d:
set Partition=Partition=%PartitionLetter%
set Path=[%PartitionLetter%]\sources
REM choice is for efi, leave blank for mbr
set choice=EFI
set applicationpath=\Windows\system32\winload.efi
set applicationpathHDD=\Windows\system32\winload.efi
set VHDname=VHD.vhd
rem ?
rem set ramdisksdipath=\Windows\system32\boot.sdi
set DisplayBootMenu=%BCDEDIT% %STORE% /set {bootmgr} DisplayBootMenu False
set memtest=\Windows\Boot\EFI\memtest.efi
%BCDEDIT% /set {current} bootmenupolicy standard
goto :CREATECUSTOMHDD%choice%





:CREATECUSTOMDVD
call :CREATEBCD
call :Ramdisk
call :BootCdriveMBRDVD
call :WIM_bootwim
call :GRUB4DOS 
call :GRUB2 
rem call :GRUB24DOS 
call :SYSLINUX
call :ISOLINUX
call :BCD_ISO_DISK
call :BCD_ISO_MEM
call :BCD_IMG
call :BCD_GZ
rem call :ISO_Gena_WIM
rem call :XPWIM
rem call :WIM_w7x86
rem call :WIM_w7x64
rem call :WIM_w8x86
rem call :WIM_w8x64
call :WIM_DART_w7x86
call :WIM_DART_w7x64
call :WIM_DART_w8x86
call :WIM_DART_w8x64
rem call :WIM_DART_wVx86
rem call :WIM_DART_wVx64
call :XPntldrHDD
call :XPNORMAL
rem call :XPADMIN
rem call :XPES
rem call :ISO_Mac
rem call :Plop
rem call :BootC
rem call :BootD
rem call :BootE
rem call :BootF
rem call :BootG
rem call :BootH
rem call :W2Go
rem call :VHDDVD
rem call :VHDHDD
rem call :VHDXDVD
rem call :VHDXHDD
rem call :pxeWindows
call :pxelinux
call :EFI_BootBIN
rem call :MEMTEST
%BCDEDIT% %STORE% /timeout 10
rem %BCDEDIT% %STORE% /enum
rem pause
goto :ORDERBCD
goto :StartBCD



:CREATECUSTOMHDD
rem bcdboot C:\Windows
rem call :CREATEBCD
rem call :BootC
call :Ramdisk
rem call :VHDHDDw7x86
rem call :VHDHDDw7x64
call :VHDHDDw8x86
rem call :VHDHDDw8x64
rem call :XPPE
call :WIM_w8x64
rem call :WIM_w8x86
rem call :WIM_w7x64
rem call :WIM_w7x86
rem call :WIM_DART_w7x86
rem call :WIM_DART_w7x64
rem call :WIM_DART_w8x86
rem call :WIM_DART_w8x64
rem call :WIM_DART_wVx86
rem call :WIM_DART_wVx64
rem call :XPntldrHDD
rem call :XPNORMAL
rem call :XPADMIN
rem call :XPES
rem call :BootD
rem call :BootE
rem call :BootF
rem call :BootG
rem call :BootH
rem call :W2Go
rem call :VHDDVD
rem call :VHDHDD
rem call :VHDXDVD
rem call :VHDXHDD
rem call :WIM_bootwim
call :GRUB4DOS 
call :SYSLINUX
%BCDEDIT% %STORE% /default {current}
%BCDEDIT% %STORE% /timeout 10
rem %BCDEDIT% %STORE% /enum
rem pause
goto :ORDERBCD
goto :StartBCD



:CREATECUSTOMDVDEFI
call :CREATEBCD
call :Ramdisk
call :WIM_bootwim
rem call :GRUB4DOS 
rem call :SYSLINUX
rem call :ISOLINUX
rem call :XPPE
rem call :WIM_w7x86
rem call :WIM_w7x64
rem call :WIM_w8x86
rem call :WIM_w8x64
rem call :WIM_DART_w7x86
call :WIM_DART_w8x64
rem call :WIM_DART_w8x86
call :WIM_DART_w7x64
rem call :WIM_DART_w8x86
rem call :WIM_DART_wVx86
rem call :WIM_DART_wVx64
rem call :XPntldrHDD
rem call :XPNORMAL
rem call :XPADMIN
rem call :XPES
rem call :BootC
rem call :BootD
rem call :BootE
rem call :BootF
rem call :BootG
rem call :BootH
rem call :W2Go
rem call :VHDDVD
rem call :VHDHDD
rem call :VHDXDVD
rem call :VHDXHDD
rem call :GRUB2EFI
rem call :BootC
rem call :BootCdriveMBRDVD
rem call :GRUB4DOS 
call :BootCdriveEFIDVD
%BCDEDIT% %STORE% /timeout 10
rem %BCDEDIT% %STORE% /enum
rem pause
goto :ORDERBCD
goto :StartBCD





:CREATECUSTOMHDDEFI
rem bcdboot C:\Windows
rem call :CREATEBCD
call :Ramdisk
rem call :WIM_bootwim
rem call :BootC
rem call :GRUB4DOS 
rem call :SYSLINUX
rem call :ISOLINUX
rem call :XPPE
rem call :WIM_w7x86
call :WIM_w7x64
rem call :WIM_w8x86
call :WIM_w8x64
rem call :WIM_DART_w7x86
rem call :WIM_DART_w7x64
rem call :WIM_DART_w8x86
rem call :WIM_DART_w8x64
rem call :WIM_DART_wVx86
rem call :WIM_DART_wVx64
rem call :XPntldrHDD
rem call :XPNORMAL
rem call :XPADMIN
rem call :XPES
rem call :BootD
rem call :BootE
rem call :BootF
rem call :BootG
rem call :BootH
rem call :W2Go
rem call :VHDDVD
rem call :VHDHDD
rem call :VHDXDVD
rem call :VHDXHDD
%BCDEDIT% %STORE% /default {current}
%BCDEDIT% %STORE% /timeout 10
rem %BCDEDIT% %STORE% /enum
rem pause
goto :ORDERBCD
goto :StartBCD





:DELETEBCD 
echo. 
echo   1 = DVD (%BCD%)
echo.
echo   2 = HDD (System)
echo.
echo. 
SET /P IM=Input number : 
SET DD=
If "%IM%"=="1" goto :DVD
If "%IM%"=="2" goto :HDD
If "%DD%"=="" echo INVALID NUMBER
If "%DD%"=="" goto :STARTBCD

:DVD
set STORE=/store %BCD%
goto :DELETEBCD1

:HDD
set STORE=
goto :DELETEBCD1

:DELETEBCD1
set _count=1
for /f "tokens=1* usebackq skip=1" %%a in (`"%BCDEDIT% %STORE% | c:\windows\system32\find "identifier""`) do (call :DELETEBCD2 %_count%)
:DELETEBCD2
if "%1" neq "" (set /a _count+=1 &amp;for /f "tokens=1* usebackq skip=%_count%" %%c in (`"%BCDEDIT% %STORE% | c:\windows\system32\find "description""`) do (echo            %_count%. %%d &amp;goto :eof))
set _choice=
echo.
echo.
set /p _choice=Enter a number (Q to quit): 
echo.
echo.
if "%_choice%" equ "" goto :STARTBCD 
if "%_choice%" gtr "0" if %_choice% lss %_count% for /f "tokens=2 usebackq skip=%_choice%" %%a in (`"%BCDEDIT% %STORE% | c:\windows\system32\find "identifier""`) do (%BCDEDIT% %STORE% /delete %%a /f &amp;goto :DELETEBCD1)
goto :STARTBCD









:Win8Safemode
 %BCDEDIT% /copy {current} /d "Windows 8 (Safe Mode)"
 %BCDEDIT% /timeout 10 
 cls
  echo.
  echo.
  echo   Activate Win8 Safe Mode
  echo.
  echo.
set _count=1
for /f "tokens=1* usebackq skip=1" %%a in (`"%BCDEDIT% | c:\windows\system32\find "identifier""`) do (call :safemode %_count%)
:safemode  
if "%1" neq "" (set /a _count+=1 &amp;for /f "tokens=1* usebackq skip=%_count%" %%c in (`"%BCDEDIT% | c:\windows\system32\find "description""`) do (echo            %_count%. %%d &amp;goto :eof))
set _choice=
echo.
echo.
set /p _choice=Enter a number (Q to quit): 
echo.
echo.
if "%_choice%" equ "" goto :eof 
if "%_choice%" gtr "0" if %_choice% lss %_count% for /f "tokens=2 usebackq skip=%_choice%" %%a in (`"%BCDEDIT% | c:\windows\system32\find "identifier""`) do (%BCDEDIT% /set %%a safeboot minimal &amp;goto :safemode2)
:safemode2
cd c:\windows\system32
reagentc /enable
 %BCDEDIT% /set {current} bootmenupolicy standard
 %BCDEDIT%
pause
goto :StartBCD













:CREATEBCD
Echo Create BCD
%BCDEDIT% /createstore %BCD%

Echo Create BootManager
%BCDEDIT% %STORE% /create {bootmgr}
%BCDEDIT% %STORE% /set {bootmgr} description "Windows Boot Manager"
%BCDEDIT% %STORE% /set {bootmgr} device %partition%
%BCDEDIT% %STORE% /set {bootmgr} locale en-US
%BCDEDIT% %STORE% /set {bootmgr} nointegritychecks YES
rem ***displaybootmenu disables win8 menu***
rem %BCDEDIT% %STORE% /set {bootmgr} DisplayBootMenu True
%DisplayBootMenu%
%BCDEDIT% %STORE% /timeout 10
Echo Bad memory
%BCDEDIT% %STORE% /create {badmemory}
Echo EMS
%BCDEDIT% %STORE% /create {emssettings}
rem text
rem %BCDEDIT% %STORE% /set {emssettings} bootems "Yes"
rem UI
%BCDEDIT% %STORE% /set {emssettings} bootems "No"
Echo Debug
%BCDEDIT% %STORE% /create {dbgsettings}
%BCDEDIT% %STORE% /dbgsettings SERIAL DEBUGPORT:1 BAUDRATE:115200
Echo Hypervisor
%BCDEDIT% %STORE% /create {hypervisorsettings}
%BCDEDIT% %STORE% /hypervisorsettings SERIAL DEBUGPORT:1 BAUDRATE:115200
Echo Global settings
%BCDEDIT% %STORE% /create {globalsettings}
%BCDEDIT% %STORE% /set {globalsettings} INHERIT {dbgsettings} {emssettings} {badmemory}
%BCDEDIT% %STORE% /set {bootmgr} INHERIT {globalsettings}
Echo Bootloader settings
%BCDEDIT% %STORE% /create {bootloadersettings}
%BCDEDIT% %STORE% /set {bootloadersettings} INHERIT {globalsettings} {hypervisorsettings}
Echo Resume
REM %BCDEDIT% %STORE% /create {resumeloadersettings}
REM %BCDEDIT% %STORE% /set {resumeloadersettings} INHERIT {globalsettings}
Echo Memtest
%BCDEDIT% %STORE% /create {memdiag}
%BCDEDIT% %STORE% /set {memdiag} description "Windows Memory Diagnostic"
rem %BCDEDIT% %STORE% /set {memdiag} device partition=\Device\HarddiskVolume1
%BCDEDIT% %STORE% /set {memdiag} device %partition%
%BCDEDIT% %STORE% /set {memdiag} path %memtest%
%BCDEDIT% %STORE% /set {memdiag} locale en-US
%BCDEDIT% %STORE% /set {memdiag} inherit {globalsettings}
REM %BCDEDIT% %STORE% /set {memdiag} badmemoryaccess Yes
%BCDEDIT% %STORE% /toolsdisplayorder {memdiag}
goto :eof



:Ramdisk
Echo Ramdisk settings
%BCDEDIT% %STORE% /create {ramdiskoptions}
%BCDEDIT% %STORE% /set {ramdiskoptions} ramdisksdidevice %partition%
rem %BCDEDIT% %STORE% /set {ramdiskoptions} ramdisksdipath %ramdisksdipath%
%BCDEDIT% %STORE% /set {ramdiskoptions} ramdisksdipath \boot\boot.sdi 
goto :eof


:MEMTEST
echo MEMTEST 
%BCDEDIT% %STORE% /create {memdiag}
%BCDEDIT% %STORE% /set {memdiag} description "Windows Memory Diagnostic"
rem %BCDEDIT% %STORE% /set {memdiag} device partition=\Device\HarddiskVolume1
%BCDEDIT% %STORE% /set {memdiag} device %partition%
%BCDEDIT% %STORE% /set {memdiag} path %memtest%
rem %BCDEDIT% %STORE% /set {memdiag} locale en-US
rem %BCDEDIT% %STORE% /set {memdiag} inherit {globalsettings}
REM %BCDEDIT% %STORE% /set {memdiag} badmemoryaccess Yes
%BCDEDIT% %STORE% /toolsdisplayorder {memdiag}
%BCDEDIT% %STORE% /displayorder {memdiag} /addlast
goto :eof



:BCD_ISO_DISK
echo BCD_ISO_DISK
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Boot ISO (Disk)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\BCD_ISO_DISK
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof



:BCD_ISO_MEM
echo BCD_ISO_MEM
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Boot ISO (Memory)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\BCD_ISO_MEM
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:BCD_IMG
echo BCD_IMG
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Boot IMG (Floppy Image)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\BCD_IMG
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:BCD_GZ
echo BCD_GZ
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Boot GZ Zip file (Memdisk)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\BCD_GZ
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:BCD_ISO_Mac
echo BCD_ISO_Mac
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Mac OSX Boot Loader (Chameleon)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\BCD_ISO_Mac
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof



:Plop
echo Plop
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Plop" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\BCD_ISO_Plop
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:GRUB4DOS 
echo GRUB4DOS 
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Grub4dos" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\grub4dos\grldr
rem %BCDEDIT% %STORE% /set %guid% path \grldr.mbr
rem %BCDEDIT% %STORE% /set %guid% path \boot\grub\grldr.mbr
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:GRUB2
echo GRUB2
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Grub2" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\grub\g2ldr
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof



:GRUB2EFI
echo GRUB2
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Grub2 %choice%" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \efi\boot\grubx64.efi
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof



:BURG
echo BURG
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Burg" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\burg\g2ldr
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:SYSLINUX
echo SYSLINUX
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Syslinux (USB)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\syslinux\syslinux.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:ISOLINUX
echo ISOLINUX 
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "Isolinux (CD\DVD)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\syslinux\isolinux.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof



:EFI_BootBIN
echo SYSLINUX
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "EFI Boot" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \efi\microsoft\boot\Grub.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof




:XPPE
echo XP PE
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "WinXP Mini PE" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\SETUPLDR.BIN
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:ISO_Gena_WIM
echo Gena_WIM 
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "GenaXP LiveCD" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\BCDs\ISO_Gena_WIM
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:XPntldrHDD
echo XP HDD
%BCDEDIT% %STORE% /create {ntldr} /d "WinXP {ntldr}"
%BCDEDIT% %STORE% /set {ntldr} device %partition%
%BCDEDIT% %STORE% /set {ntldr} path \ntldr
%BCDEDIT% %STORE% /displayorder {ntldr} /addlast
goto :eof
:XPNORMAL
echo XP normal
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "WinXP (SETUPLDR.bin) (CD\DVD)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \I386\SETUPLDR.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof
:XPADMIN
echo XP admin
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "WinXP Admin (i386\SETUPLDU.bin) (CD\DVD)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \I386\SETUPLDU.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof
:XPES
echo XP Enter settings
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "WinXP Enter Settings (i386\SETUPLDE.bin) (CD\DVD)" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \I386\SETUPLDE.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:W2Go
echo Windows to go
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "Windows to Go [boot] (Win8 Enterprise)"
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% osdevice %partition%
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:VHDDVD
echo VHDDVD
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device vhd=%Path%\%VHDname%
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% osdevice vhd=%Path%\%VHDname%
rem %BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "VHD (%Path%\%VHDname%)"
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:VHDHDD
echo VHDHDD
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device vhd=%Path%\%VHDname%
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% osdevice vhd=%Path%\%VHDname%
rem %BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "VHD (%Path%\%VHDname%)"
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof

:VHDXDVD
echo VHDDVD
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device vhd=%Path%\%VHDname%x
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% osdevice vhd=%Path%\%VHDname%x
rem %BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "VHDX (%Path%\%VHDname%x)"
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:VHDXHDD
echo VHDHDD
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device vhd=%Path%\%VHDname%x
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% osdevice vhd=%Path%\%VHDname%x
rem %BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "VHDX (%Path%\%VHDname%)"
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:VHDHDDw7x86
echo VHDHDDw7x86
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device vhd=%Path%\w7x86.vhd
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% osdevice vhd=%Path%\w7x86.vhd
rem %BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "w7x86 VHD (%Path%\w7x86.vhd)"
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:VHDHDDw7x64
echo VHDHDDw7x64
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device vhd=%Path%\w7x64.vhd
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% osdevice vhd=%Path%\w7x64.vhd
rem %BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "w7x64 VHD (%Path%\w7x64.vhd)"
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:VHDHDDw8x86
echo VHDHDDw8x86
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device vhd=%Path%\w8x86.vhd
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% osdevice vhd=%Path%\w8x86.vhd
rem %BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "w8x86 VHD (%Path%\w8x86.vhd)"
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:VHDHDDw8x64
echo VHDHDDw8x64
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device vhd=%Path%\w8x64.vhd
%BCDEDIT% %STORE% /set %guid% path %applicationpath%
%BCDEDIT% %STORE% /set %guid% osdevice vhd=%Path%\w8x64.vhd
rem %BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "w8x64 VHD (%Path%\w8x64.vhd)"
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof


:pxelinux
echo pxelinux
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "pxelinux" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
%BCDEDIT% %STORE% /set %guid% path \boot\syslinux\pxelinux.bin
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof



:pxeWindows
echo pxeWindows
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /d "pxeboot.n12" /application bootsector') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device %partition%
REM %BCDEDIT% %STORE% /set %guid% path \boot\bootpxe\grldr
%BCDEDIT% %STORE% /set %guid% path \boot\bootpxe\pxeboot.n12
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof




:BootCdriveMBRDVD
echo BootCdriveMBRDVD
set Drive=c:
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device partition=%Drive%
%BCDEDIT% %STORE% /set %guid% path \Windows\system32\winload.exe
%BCDEDIT% %STORE% /set %guid% osdevice partition=%Drive%
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "Windows %Drive%"
%BCDEDIT% %STORE% /set %guid% bootmenupolicy %bootmenupolicy%
rem %BCDEDIT% %STORE% /set %guid% detecthal yes
%BCDEDIT% %STORE% /set %guid% nx optin
%BCDEDIT% %STORE% /set %guid% locale en-us
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof



:BootCdriveEFIDVD
echo BootCdriveMBRDVD
set Drive=c:
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device partition=%Drive%
%BCDEDIT% %STORE% /set %guid% path \Windows\system32\winload.efi
%BCDEDIT% %STORE% /set %guid% osdevice partition=%Drive%
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "Windows %Drive%"
%BCDEDIT% %STORE% /set %guid% bootmenupolicy %bootmenupolicy%
rem %BCDEDIT% %STORE% /set %guid% detecthal yes
%BCDEDIT% %STORE% /set %guid% nx optin
%BCDEDIT% %STORE% /set %guid% locale en-us
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof




:BootC
echo Windows c:
set Drive=C:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BootD
echo Windows D:
set Drive=D:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BootE
echo Windows E:
set Drive=E:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BootF
echo Windows F:
set Drive=F:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BootG
echo Windows G:
set Drive=G:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BootH
echo Windows H:
set Drive=H:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BootI
echo Windows I:
set Drive=I:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BootJ
echo Windows J:
set Drive=J:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BootK
echo Windows K:
set Drive=K:
set bootmenupolicy=standard
rem set bootmenupolicy=legacy
goto :BOOT
:BOOT
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% device partition=%Drive%
%BCDEDIT% %STORE% /set %guid% path %applicationpathHDD%
%BCDEDIT% %STORE% /set %guid% osdevice partition=%Drive%
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% description "Windows %choice% %Drive%"
rem %BCDEDIT% %STORE% /set %guid% bootmenupolicy %bootmenupolicy%
%BCDEDIT% %STORE% /set %guid% detecthal yes
%BCDEDIT% %STORE% /set %guid% nx optin
rem %BCDEDIT% %STORE% /set %guid% locale en-US
rem for bitlocker library_custom:0x17000077 set to 3   BcdLibraryIntegerList_AllowedInMemorySettings, i dunno...
rem %BCDEDIT% %STORE% /set %guid%  ems "yes"
rem %BCDEDIT% %STORE% /ems %guid% on
rem %BCDEDIT% %STORE% /set %guid2%  RecoveryOs true
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof



:WIM_bootwim
Echo boot.wim
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set guid=%%A
%BCDEDIT% %STORE% /set %guid% systemroot \windows
%BCDEDIT% %STORE% /set %guid% detecthal yes
%BCDEDIT% %STORE% /set %guid% winpe yes
%BCDEDIT% %STORE% /set %guid% OSDEVICE ramdisk=%path%\boot.wim,{ramdiskoptions}
%BCDEDIT% %STORE% /set %guid% DEVICE ramdisk=%path%\boot.wim,{ramdiskoptions} 
%BCDEDIT% %STORE% /set %guid% description "Windows Setup %choice% (%path%\boot.wim)"
rem %BCDEDIT% %STORE% /set %guid% path %applicationpath%
rem %BCDEDIT% %STORE% /set %guid% locale en-US
rem %BCDEDIT% %STORE% /set %guid% INHERIT {bootloadersettings}
rem %BCDEDIT% %STORE% /set %guid% bootmenupolicy legacy
rem %BCDEDIT% %STORE% /set %guid% bootmenupolicy standard
rem %BCDEDIT% %STORE% /set %guid%  nx optin
rem %BCDEDIT% %STORE% /set %guid%  ems "no"
rem %BCDEDIT% %STORE% /ems %guid% on
rem %BCDEDIT% %STORE% /bootems %guid% on
%BCDEDIT% %STORE% /default %guid%  
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof




:WIM_DART_w7x86
echo Win DART 7 %choice% x86 
set pename="Win7 %choice% Setup\DART x86 (%path%\w7x86\boot.wim)"
set filena=%Path%\w7x86\boot.wim
goto :WIMAll
:WIM_DART_w7x64
echo Win DART 7 %choice% x64 
set pename="Win7 %choice% Setup\DART x64 (%path%\w7x64\boot.wim)"
set filena=%Path%\w7x64\boot.wim
goto :WIMAll
:WIM_DART_w8x86
echo Win DART 8 %choice% x86 
set pename="Win8 %choice% Setup\DART x86 (%path%\w8x86\boot.wim)"
set filena=%Path%\w8x86\boot.wim
goto :WIMAll
:WIM_DART_w8x64
echo Win DART 8 %choice% x64 
set pename="Win8 %choice% Setup\DART x64 (%path%\w8x64\boot.wim)"
set filena=%Path%\w8x64\boot.wim
goto :WIMAll
:WIM_DART_wVx86
echo Win DART Vista %choice% x86 
set pename="Vista %choice% Setup\DART x86 (%path%\wVx86\boot.wim)"
set filena=%Path%\wVx86\boot.wim
goto :WIMAll
:WIM_DART_wVx64
echo Win DART Vista x64 
set pename="Vista %choice% Setup\DART x64 (%path%\wVx64\boot.wim)"
set filena=%Path%\wVx64\boot.wim
goto :WIMAll
:WIM_w7x86
echo WinPE 7 %choice%
set pename="WinPE 7 %choice% x86 (%path%\w7x86.wim)"
set filena=%Path%\w7x86.wim
goto :WIMAll
:WIM_w7x64
echo WinPE 7 %choice% x64
set pename="WinPE 7 %choice% x64 (%path%\w7x64.wim)"
set filena=%Path%\w7x64.wim
goto :WIMAll
:WIM_w8x86
echo WinPE 8 %choice%
set pename="WinPE 8 %choice% x86 (%path%\w8x86.wim)"
set filena=%Path%\w8x86.wim
goto :WIMAll
:WIM_w8x64
echo WinPE 8 %choice% x64
set pename="WinPE 8 %choice% x64 (%path%\w8x64.wim)"
set filena=%Path%\w8x64.wim
goto :WIMAll

:WIMALL
rem create a new ramdisk where you can specify a different boot.sdi.  last entry here http://diddy.boot-land.net/bcdedit/files/examples1.htm#winpe
for /f "tokens=3" %%A in ('%BCDEDIT% %STORE% /create /device') do set ramdisk=%%A 
%BCDEDIT% %STORE% /set %ramdisk% ramdisksdidevice %partition%
%BCDEDIT% %STORE% /set %ramdisk% ramdisksdipath \boot\boot.sdi 
for /f "Tokens=3" %%A in ('%BCDEDIT% %STORE% /create /application osloader') do set GUID=%%A
%BCDEDIT% %STORE% /set %guid% systemroot \Windows
%BCDEDIT% %STORE% /set %guid% detecthal Yes
%BCDEDIT% %STORE% /set %guid% winpe Yes
%BCDEDIT% %STORE% /set %guid% osdevice ramdisk=%filena%,%ramdisk%
%BCDEDIT% %STORE% /set %guid% device ramdisk=%filena%,%ramdisk%
rem %BCDEDIT% %STORE% /set %guid% osdevice ramdisk=[C:]\Sources\boot.wim,%ramdisk%
rem %BCDEDIT% %STORE% /set %guid% device ramdisk=[C:]\Sources\boot.wim,%ramdisk%
rem %BCDEDIT% %STORE% /set %guid% path %applicationpath%
rem %BCDEDIT% %STORE% /set %guid% locale en-US
rem %BCDEDIT% %STORE% /set %guid% INHERIT {bootloadersettings}
rem %BCDEDIT% %STORE% /set %guid% bootmenupolicy legacy
rem %BCDEDIT% %STORE% /set %guid% bootmenupolicy standard
rem %BCDEDIT% %STORE% /set %guid%  nx optin
rem %BCDEDIT% %STORE% /set %guid%  ems "no"
rem %BCDEDIT% %STORE% /ems %guid% on
rem %BCDEDIT% %STORE% /bootems %guid% on
rem %BCDEDIT% %STORE% /default %guid%  
%BCDEDIT% %STORE% /set %guid% description %pename%
%BCDEDIT% %STORE% /displayorder %guid% /addlast
goto :eof







:ORDERBCD
title Choose Order or quit
cls
%BCDEDIT% %STORE%
echo.  
echo   Ordering of items on the Boot Menu    
echo.        
set _count=1
for /f "tokens=1* usebackq skip=1" %%a in (`"%BCDEDIT% %STORE% | c:\windows\system32\find "identifier""`) do (call :ORDERBCD1 %_count%)
:ORDERBCD1
if "%1" neq "" (set /a _count+=1 &amp;for /f "tokens=1* usebackq skip=%_count%" %%c in (`"%BCDEDIT% %STORE% | c:\windows\system32\find "description""`) do (echo            %_count%. %%d &amp;goto :eof))
echo.
echo   Choose one you want to put into the first slot or exit
echo.
set _choice=
set /p _choice=Enter a number (Q to quit): 
if "%_choice%" equ "" goto :ORDERBCD
if "%_choice%" equ "q" goto :STARTbcd
if "%_choice%" gtr "0" if %_choice% lss %_count% for /f "tokens=2 usebackq skip=%_choice%" %%a in (`"%BCDEDIT% %STORE% | c:\windows\system32\find "identifier""`) do (%BCDEDIT% %STORE% /displayorder %%a /addfirst &amp;goto :STARTbcd)
%BCDEDIT% %STORE%
pause
goto :eof


:eof

 
Can anybody tell me about the actual use of this Script with more specific and detailed description......

Will this script be useful for my case ?

Regards......

#14 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 27 July 2014 - 07:09 PM

Actually there is no problem/issue with 'zbootmgr.exe'. It just work perfectly for me.

Which bootmgr version do you edit with 'zbootmgr.exe'?
Does this include windows 8 SP1 U1 bootmgr?
Does Wimboot booting works that way?

 

Will this script be useful for my case ?

I don't know.
It's about one bcd file. Didn't you like to avoid this?

#15 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 27 July 2014 - 07:27 PM

Which bootmgr version do you edit with 'zbootmgr.exe'?
Does this include windows 8 SP1 U1 bootmgr?
Does Wimboot booting works that way?


I have used 'BOOTMGR_Win7RTM' and it work for 'Win 8.1 U1' based 'boot.wim' and 'WIMBoot.vhdx'.

I had not tried 'BOOTMGR_Win8.1RTM' because I don't have...........Do you have it ?

It's about one bcd file. Didn't you like to avoid this?


If script is about one BCD file, then it is not useful for me..........Thanks for alerting me.......

Regards........

#16 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 27 July 2014 - 09:07 PM

I used Win 8.1 U1 bootmgr for wimboot so far.

If script is about one BCD file, then

you may use it. Add one setting and create a new bcd file

#17 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 28 July 2014 - 12:28 AM

I used Win 8.1 U1 bootmgr for wimboot so far.

 

I am also using Win 8.1 U1 bootmgr for WIMBoot so far which is already modified. And 'zbootmgr' does not accept already modified 'bootmgr'. I don't have any unmodified  'BOOTMGR_Win8.1RTM' in order to test with 'zbootmgr'. 

 

Does 'zbootmgr' accept your Win 8.1 U1 bootmgr ?

 

Regards



#18 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 28 July 2014 - 10:16 PM

Does 'zbootmgr' accept your Win 8.1 U1 bootmgr ?

I don't know. I dislike editing bootmgr and prefer to edit bcd.

A old floppy in RAM patch bcd example, Windows 7 back then:
http://reboot.pro/to...e-2#entry145675

#19 Fryquez

Fryquez
  • Members
  • 3 posts

Posted 29 July 2014 - 07:28 AM

@devdevadev

Don't use Windows 7 bootmgr to boot a Windows 8, it's not fully compatible.

If you really need to change bootmgr than see this post

 

http://www.msfn.org/...tmgr-windows-8/



#20 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 29 July 2014 - 10:36 AM

@devdevadev[/size]

Don't use Windows 7 bootmgr to boot a Windows 8, it's not fully compatible.
If you really need to change bootmgr than see this post
 
http://www.msfn.org/...tmgr-windows-8/
Which brings back right to what was already posted on post #2. :whistling:
 
@devdevadev
JFYI, "point b." is a set of floppy images WITHOUT any need to modify the BOOTMGR or BCD name in them.
http://reboot.pro/to...r-wim/?p=186158
 
:duff:
Wonko

#21 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 29 July 2014 - 02:25 PM

JFYI, "point b." is a set of floppy images WITHOUT any need to modify the BOOTMGR or BCD name in them.
http://reboot.pro/to...r-wim/?p=186158

 

You mean I have to to create three floppy images as follows and have to put then within \_ISO\MAINMENU .

 

floppy image 1 - It will contain bootmgr and \boot\bcd correspond to 'Win 8.1 U1 Installer'

floppy image 2 - It will contain bootmgr and \boot\bcd correspond to 'Win8.1U1SE_x64_boot.wim'

floppy image 3 - It will contain bootmgr and \boot\bcd correspond to 'WIMBoot.vhdx'

 

Could I understand correctly or not ?

 

Regards......



#22 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 29 July 2014 - 02:34 PM

Sure, the idea is that, with no need to "edit" or "rename" *anything*.

 

Where you put it the floppy images is your problem, of course, or more loosely the problem might be to change Easy2boot scripts/menus to recognize them (or whatever).

 

Booting through one of them in plain grub4dos command line amounts to (more or less):





map --mem /floppyN.img (fd0)
map --hook
root (fd0)
chainloader /bootmgr
boot

:duff:

Wonko



#23 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 29 July 2014 - 03:48 PM

It means I have to first create following three floppy images from respective bootmgr and \boot\bcd .

 

1-Win8.1U1_Installer.img

2-Win8.1U1SE_x64_boot.img

3-WIMBoot.img

 

and then also have to put following three .mnu files within Easy2boot in order to recognize respective floppy images.

 

1- Win8.1U1_Installer.mnu

map --mem /Win8.1U1_Installer.img (fd0)
map --hook
root (fd0)
chainloader /bootmgr
boot

2- Win8.1U1SE_x64_Boot.mnu

map --mem /Win8.1U1SE_x64_Boot.img (fd0)
map --hook
root (fd0)
chainloader /bootmgr
boot

3- WIMBoot.mnu

map --mem /WIMBoot.img (fd0)
map --hook
root (fd0)
chainloader /bootmgr
boot

Am I going right or not ?

 

If 'Yes' , then How to create floppy images from bootmgr and \boot\bcd ?

 

Regards....



#24 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 29 July 2014 - 04:54 PM

You have a strange ability for jumping to conclusions as opposed to go with a step by step approach :unsure:, you cannot seriously think to build an "advanced" ultimate-super-mega-hyper boot stick if you don' t learn first the basics (and yes, making a floppy disk image is a very basic piece of knowledge in the "booting field")

  1. FIRST learn to make a floppy image, and the ALREADY GIVEN links provide some good hints, however I have one word for you: IMDISK. [1]
  2. Then copy to the floppy image an ALREADY working and tested BOOTMGR + \boot\BCD (i.e. copy to the floppy image your current, tested, working set)
  3. Then try the approach on COMMAND LINE <- this means NOT "make a .mnu file (whatever a .mnu file is, the extension for grub4dos menu files is .lst by convention, and it needs a "title" and it needs NOT a "boot" command), it means "test on command line".
  4. Then (optionally) optimize the above by using instead  of a plain 1.44 Mb floppy image smaller floppy images or try them gzipped, and/or (even more optionally) experiment with small .iso's or hard disk images instead and the COSMIAS approach (that would BTW remove altogether the need for several menus) 
  5. Then repeat the test with different sets of BOOTMGR + \boot\BCD, creating more floppy images (or whatever images)
  6. Then FINALLY find a way to automate/integrate the thing in a set of grub4dos menus or in Easy2boot structure or whatever.

 

:duff:

Wonko

 

[1] How difficult can it be :dubbio::

http://en.lmgtfy.com...oppy disk image

to find this (just as an example): 

 http://www.rmprepusb...orials/winimage

there are of course tens of ways to create a floppy disk images ... you can even use Excel :w00t: and a few basic tools (shameless plug ;)):

http://www.msfn.org/...ation/?p=972044

http://www.msfn.org/...mages/?p=988732

choose the one you find more convenient... (the spreadsheet above is to be considered "advanced-advanced" :ph34r:, but by reading those threads and looking at how the spreadsheet is made I am sure you can learn a lot of things)



#25 devdevadev

devdevadev

    Silver Member

  • Advanced user
  • 540 posts
  •  
    India

Posted 29 July 2014 - 05:36 PM

Sorry for silly question......Actually I had never used floppy images till now. I had only created and used .imgPTN images with the help of IMDISK. I was thinking that creating 'floppyN.img' will be little tricky/different. It's why I asked you without doing GOOGLE. But now it's looking that .img images are just like .imgPTN images. Only difference in extension and COMMAND LINE approach. Actually I became so happy to know about floppy images method that I forget to GOOGLE for it.............I think 1.44MB floppy disk images will be more useful for me ............

 

Thanks a lot for such a great alternative method......It's looking very interesting and amazing. 

 

Regards......







Also tagged with one or more of these keywords: bootmgr, bcd, boot, zbootmgr

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users