TechSpot

Using BCDEdit in Vista

By Poppa Bear
Jul 28, 2009
  1. Hi all,

    Can anyone tell me the exact syntax to type in for commands in BCDEdit in Win Vista Ult so as to:

    • List the operating systems available that can be added to the boot entries.
    • Add a new boot entry.

    These would be the commands that are the equivalent to the following boot edit commands in WinXP Pro:

    • Bootcfg /scan To show all operating systems available.

    • Bootcfg /add To add a new boot entry.

    I have researched Microsoft and Google for the equivalent Vista BCDEdit commands, and they list them and what they do. However, they don't show specific examples of the syntax used, especially where multiple operators are combined in the command.

    I have been able to work out how to:

    List current boot entries using the command:​

    • BCDedit /v or BCDEdit /enum.
    The first one is the preferred option because it lists the numeric/letter ID key string, whereas the other lists generic identifiers.​
    Delete an entry using the command:​

    • BCDEdit /f /delete {type in here the entry numeric/letter ID key}

    Any help would be greatly appreciated. Cheers Poppa Bear
     
  2. Tmagic650

    Tmagic650 TS Ambassador Posts: 17,244   +234

    There are other ways to add boot entries in Vista. Are you running multiple OS's or other boot devices?
     
  3. Poppa Bear

    Poppa Bear TS Enthusiast Topic Starter Posts: 237   +7

    Multiple boot

    I'm running 3 operating systems: WinXP Pro, Vista Ultimate and Win7 RC Beta. The 3 OSs were loaded in that order on three primary partitions. After using Win7 for awhile I decided to uninstall it and consequently deleted the partition and extended the Vista partition to use up the free space. However, Win7 kept coming up on the boot options, even though it went nowhere.

    After a bit of experimentation with BCDEdit, I was able to remove the boot option for Win7, but at the same time, I also lost the boot option for WinXP Pro. I have tried various commands to try and restore XP to the boot menu but no luck.

    I know the XP OS is still intact because I've been able to boot it using a third party software ISO CD entitled NTLDR Loader. When I did boot it up, I replaced the boot files in the C drive with copies of the original boot files which I had made some time back, . However, this did not restore the boot option.

    Any ideas?
     
  4. Tmagic650

    Tmagic650 TS Ambassador Posts: 17,244   +234

    Get into Vista's Control Panel, System, Advanced System Settings, Startup, system failure and debugging. See if Windows XP is in the dropdown list and set the display time
     
  5. Poppa Bear

    Poppa Bear TS Enthusiast Topic Starter Posts: 237   +7

    BCDEdit

    No XP is not listed.

    ps like your proverb quote from Lincoln
     
  6. Tmagic650

    Tmagic650 TS Ambassador Posts: 17,244   +234

    Ok,
    try doing an XP repair. Boot from an XP CD. When you see a list of the hard drive partitions, select repair. The program will continue just like a fresh install, but you will still have all your programs and desktop settings when the install finishes. You will have to install all the Windows Updates again though...
     
  7. Poppa Bear

    Poppa Bear TS Enthusiast Topic Starter Posts: 237   +7

    repair

    Thnx TMagic,

    Had thought of doing that, but since the XP operating system is still there and intact, I was hoping I could find a command in BCDEdit that will scan the hard drive for all existing operating systems and then add the XP one as a boot option.

    I have performed these operations using XP when I've had multiple OSs, by using the command lines:

    bootcfg /Add which lists all OSs on the hard drive

    bootcfg /Add which scans for all Windows installations and allows you to add any new ones to the "boot.ini"
     
  8. Tmagic650

    Tmagic650 TS Ambassador Posts: 17,244   +234

    When I set up my dual boot OS's i played with BCDEdit, but I wasn't sucessful either. I have done fresh installs, and it seems like Windows XP has to be installed first always, then Vista or Windows 7
     
  9. Poppa Bear

    Poppa Bear TS Enthusiast Topic Starter Posts: 237   +7

    Yep, that's pretty much my experience too. I loaded XP first on 1st partition, then Vista on 2nd partition and finally Win7 on 3rd partition.

    The primary boot information must be in the first partition, because this remains the active partiton. Yet if the boot entry for the XP legacy installation is removed from the Vista boot stores, as viewed with BCDEdit, then the other two work but XP doesn't. This means two things. Vista and Win7 boot initiation comes from the XP partition boot info.The boot exe for XP is linked to the boot store in Vista.

    I've played around quite a bit to try and figure out exactly what's happening. I've been able to do this at not too great a risk because I have Acronis back-up images which can restore a complete OS in 10 minutes. This is what I've found:

    1. If the XP partition is not the active partition, nothing boots.

    2. Even if the XP boot option itself is missing, provided the XP OS is still there, and the partition is active, the other two systems boot OK.

    3. The link between the systems can only be created by loading the systems in the order you mentioned.

    4. As mentioned earlier, when I lost the boot for XP and booted it using third party NTLDR on an ISO CD, I then reloaded the boot files, including boot.ini onto the C drive and it still wouldn't boot. This verifies that the actual boot info was correct but the link to Vista boot store was missing and this stopped it booting.

    Thanks for your input TMagic. I appreciate. Cheers Poppa B :wave:
     
  10. Tmagic650

    Tmagic650 TS Ambassador Posts: 17,244   +234

    Ok Poppa Bear,
    I have Vista on a 250GB SATA drive and Windows 7 on a 420GB SATA drive... Good Luck :)
     
  11. easethepain

    easethepain TS Rookie Posts: 16

    poppa Bear

    if you need to add the bootloader for vista back into the bcd

    try this

    boot from a vista cd choose the option for repair the computer take it to the point where you get an option to go to a comand prompt at this point type bootrec /scanos this will supply the information that is not in the bcd hopefully your missing vista
    next type bootrec /rebuildbcd this will then give you an option to add whichever os you want into the bcd ie your vista when you have selected y or n it should say completed sucessfully

    get back into your program that took you to the command prompt choose shutdown restart the machine and if this has worked if you have a timout on the bootloader you can choose the os too boot from or press F8

    Good luck EasethePain
     
  12. Poppa Bear

    Poppa Bear TS Enthusiast Topic Starter Posts: 237   +7

    Using BCDEdit

    Thanks for the input "easethepain"

    As an experiment I deleted the Vista boot entry from BCD. Then I followed the steps you suggested, and ran the following commands after booting from the Vista DVD and choosing the Repair option and then the Command Prompt:

    "bootrec /scanos" & "bootrec /rebuildbcd"

    As you stated the first command listed the OSs available. And the second command allowed the missing boot entry to be added to the BCD. However, prior to taking these steps, when I originally clicked "Repair" option, it scanned automatically for OSs and detected the Vista boot entry was missing and offered to repair it. After choosing this option it auto added the boot entry so it was not really necessary to do it manually. However, in my particular case there was only one OS that could possibly be added. So the question is:
    • Does the auto repair option list all the missing ones if there are more than one, or do you then need to to do it manually?
    I also tried running those commands using the Command Prompt from the active Vista interface, and it stated that "this is not recognised as an internal or external command". Do you know the commands to use from the active interface to:

    • Add particular OSs detected by the command "BCDEdit /v", such as Win7?
    • Remove an OS from the boot up menu without deleting it from the BCD store?
     
  13. easethepain

    easethepain TS Rookie Posts: 16

    Hi poppa bear,

    It is possible to just remove the entry in the bootloader when you run bcdedit /?
    run this with admin privileges.
    it will give you the options you can type in the syntax to directly edit the bcd or altenatively you can get a program called vistabcd its gui version of the same program more or less but i would suggest you backup your currrent bcd first

    hope this is helpful to you.
    EasethePain
     
  14. Poppa Bear

    Poppa Bear TS Enthusiast Topic Starter Posts: 237   +7

    exact syntax

    Thanks for the info easethepain.

    I have spent a lot of time playing around with BCDEdit, and have been able to achieve certain tasks such as delete an unwanted boot entry. Earlier in this post I showed an example of the exact syntax to use to do this, as shown in the following quote:

    • Can you give me an example of the specific syntax for the command to add or remove a boot entry, while still retaining it in the BCD store if I want to add it back in later?
     
  15. easethepain

    easethepain TS Rookie Posts: 16

    Hi Poppa Bear,

    sorry i don't have the resources to test the different scenarios all i can tell you is if you lose the boot loader for xp when duel booting it requires Ntldr and to fix this would be to boot from an xp cd to a dos prompt and choose fixboot but as this thread has continued and you have tried other things you have discovered that all os's boot from c: when duel booting but if you put windows 7 in the scenario it takes over with its own boot manager in answer to your question i do not know the exact commands to use other than what i have written in previous posts to you the best advice i can give is too query this on www.technet.com and use the knowledge base

    EasethePain
     
  16. Poppa Bear

    Poppa Bear TS Enthusiast Topic Starter Posts: 237   +7

    Hi easethepain,

    Thanks for your help. Will go to www.technet.com and see what I can find out.

    I'm a purist at heart and like to know how to do things from basics, but since making the original post, I've discovered "EasyBCD" program from "Neosmart" which can be found here.

    It's a brilliant and simple to use program, especially for multiple OSs on the one HD, and removes all the hard work from BCD editing. It can be used on any of the operating systems on the hard drive and allows you to:
    • Choose which OS controls the boot.
    • Rename boot entries.
    • Change the on-screen boot order display.
    • Add/Remove boot entries.
    • Search for new boot entries.
    As a test I manually deleted the boot entry of Vista using BCDEdit, then booted up XP and used EasyBCD to find and restore the boot entry for Vista.

    The credit goes to TechSpot because I accidentally found it on one of the posts while researching another topic.

    Cheers PB :)
     
Topic Status:
Not open for further replies.

Similar Topics

Add New Comment

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...