Windows7启动菜单轻松搞定--bcdedit.exe[color=Red][/color]昨天安装vista x64,没有把vista x86删除干净,导致系统启动出现多个选择菜单,按照习惯,是修改boot.ini文件,但是打开此文件,提示:Warning: Boot.ini is used on Windows XP and earlier operating systems. Warning: Use BCDEDIT.exe to modify Windows Vista boot options.也就是说,要修改vista的启动菜单,需要使用专门的工具~~在c:\windows\system32中搜索到bcdedit.exe,但是双击没有反应,于是运行cmd打开命令行窗口,可以执行,但是总是提示:The boot configuration data store could not be opened.Access is denied.访问被拒绝。
想了一下,应该是权限保护的问题。
在网上搜索资料,发现执行Command Prompt以"Run as administrator"方式来运行,可以获得管理员权限。
执行bcdedit /?可以获得bcdedit的帮助信息。
第一次运行bcdedit,得到信息如下:Windows Boot Manager--------------------identifier {bootmgr}device partition=D:description Windows Boot Managerlocale en-USinherit {globalsettings}default {ntldr}displayorder {ntldr}{current}{6a80a10a-ba23-1243-be6a-c181f14c4040}toolsdisplayorder {memdiag}timeout 5Windows Legacy OS Loader------------------------identifier {ntldr}device partition=D:path \ntldrdescription Earlier Version of WindowsWindows Boot Loader-------------------identifier {current}device partition=C:path \Windows\system32\winload.exedescription Microsoft Windows Vistalocale en-USinherit {bootloadersettings}osdevice partition=C:systemroot \Windowsresumeobject {e3f80351-956c-11db-b612-b7fc4a37edc1}nx OptInWindows Boot Loader-------------------identifier {6a80a10a-ba23-1243-be6a-c181f14c4040}device unknownpath \Windows\system32\winload.exedescription Microsoft Windows Vistalocale en-USinherit {bootloadersettings}osdevice unknownsystemroot \Windowsresumeobject {6a80a10b-ba23-1243-be6a-c181f14c4040}nx OptIn启动列表中,有3个系统,其中第一个是winXP,第二个是vista x64,第三个是信息丢失的vista x86。
因此在device一项写有 unknown。
每一个系统都有一个唯一的ID(identifier),所以,输入命令时,要使用ID号。
我执行了如下的命令BCDEDIT /DELETE {6a80a10a-ba23-1243-be6a-c181f14c4040} ------删除第三个系统bcdedit /set {current} Description "Microsoft Windows Vista x64" ------把第二个系统改名为Microsoft Windows Vista x64bcdedit /set {ntldr} Description "Microsoft Windows XP" ------把第一个系统改名为Microsoft Windows XP操作完成后,重新执行bcdedit,察看启动信息:Windows Boot Manager--------------------identifier {bootmgr}device partition=D:description Windows Boot Managerlocale en-USinherit {globalsettings}default {ntldr}displayorder {ntldr}{current}toolsdisplayorder {memdiag}timeout 5Windows Legacy OS Loader------------------------identifier {ntldr}device partition=D:path \ntldrdescription Microsoft Windows XPWindows Boot Loader-------------------identifier {current}device partition=C:path \Windows\system32\winload.exedescription Microsoft Windows Vista x64locale en-USinherit {bootloadersettings}osdevice partition=C:systemroot \Windowsresumeobject {e3f80351-956c-11db-b612-b7fc4a37edc1}nx OptIn使用BCDEdit修改Windows 7启动菜单BCDEdit命令简介通过命令行工具Bcdedit,我们可以添加、删除及修改BCD (Boot Configuration Data)中的对象。
在BCD中,每个对象均具有唯一的 GUID (Globally Unique Identifier : 全局唯一标识符),如系统中的每块硬盘、每个分区的GUID (全局唯一标识符)均不相同。
在BCD中,硬盘或分区的GUID可分为如下几类:·{legacy} :指存在上一代Windows系统如Windows XP的硬盘或分区;·{default} : 默认操作系统所在硬盘或分区;·{current} : 当前硬盘或分区;·{c34b751a-ff09-11d9-9e6e-0030482375e7} : 类似于这个格式的GUID指其他安装了操作系统的硬盘或分区。
(注:这只是个例子,具体数字根据硬盘或分区参数会有相应变化,但均会类似于{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}格式)。
BCDEDIT命令·bcdedit /? : 显示命令帮助·bcdedit.exe /? CREATESTORE : 显示命令参数“ CREATESTORE ”的详细信息,——当然,“ CREATESTORE ”也只是示例,使用中对其他任何可用参数也均可使用类似格式查看该参数的具体说明。
·bcdedit 或 bcdedit /enum all : 显示Windows 7系统当前的启动设置数据,这时系统中所有安装了操作系统的硬盘或分区均会显示相应的GUID 标识,如{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} 。
使用BCDEdit备份与恢复启动选项在对Windows 7的启动选项修改之前,最好先对其备份,以防万一操作失误或其他故障导致系统无法启动。
·bcdedit /export “D:\BCD Backup\Bcd Backup” : 将启动设置备份到D盘“BCD Backup”目录下;·bcdedit /import “D:\BCD Backup\Bcd Backup” : 恢复之前备份在D盘“BCD Backup”目录下启动选项。
使用BCDEdit修改启动菜单选项作为一种良好的操作习惯,在对Windows 7的启动选项进行任何修改前,首先要对BCD 中的启动选项进行备份,相应的命令上页我们已介绍过,在此不再赘述;其次,使用“bcdedit ”或“ bcdedit /enum all ”来查看系统中硬盘或分区的正确 GUID 标识,并将其记录下来。
毕竟,BCDEdit只是一款命令行工具,我们操作时需手动输入类似“{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}”这样的长字符串时,很容易出错,而这往往会导致Windows 7启动失败。
下面详细介绍使用BCDEdit修改启动选项的常用命令格式:·bcdedit /set {legacy} Description “Windows XP Professional SP2” : 修改上一代操作系统在启动菜单中的显示内容,比如说我们也可将其修改为“Vista天地专用XP SP2”之类。
注意,命令中的引号不可省略;·bcdedit /set {current} description “Windows 7 Build 5270 x86″ : 修改当前启动硬盘或分区上的操作系统在启动菜单中的显示内容。
注意,当前分区上的操作系统可能为Windows 7,也可以是其他系统,当然,命令中的引号也不可省略;·bcdedit /set {5189b25c-5558-4bf2-bca4-289b11bd29e2} description “Windows 7 Build 5270 x64” : 修改安装于其他硬盘或分区的系统在启动菜单中的显示内容,使用这项命令时一定要注意该硬盘/分区的GUID输入正确,相应的GUID可通过“ bcdedit ”或“ bcdedit /enum all ”命令查看。