我正在尝试将计算机重新启动到包含Windows PE的闪存驱动器介质中,但每次只启动准备自动修复.这是我的powershell生成新的bcd条目:
$drive = (get-location).Drive.Name + ":"
$output = bcdedit /copy '{current}' /d "automaticabd"
$variable = "{" + $output.Split('{')[-1]
$variable = $variable.TrimEnd('.')
"Attaching $variable to device partition $drive"
bcdedit /set $variable device partition=$drive
""
"Attaching $variable to osdevice partition $drive"
bcdedit /set $variable osdevice partition=$drive
""
"Setting $variable path to EFI: \EFI\Boot\bootx64.efi"
bcdedit /set $variable path \EFI\Boot\bootx64.efi
""
"Other settings..."
bcdedit /set $variable systemroot \windows
bcdedit /set $variable winpe yes
bcdedit /set $variable recoveryenabled No
bcdedit /bootsequence $variable
Run Code Online (Sandbox Code Playgroud)
所有操作都已成功完成,看起来好像条目是正确的:
但是,当我重新启动计算机时,我曾经收到消息"修复自动恢复",然后最终进入Windows恢复环境.我已经添加 …
我正在尝试将 SSD 添加到启动菜单。我按照Microsoft提供的说明进行操作。但我不断收到同样的错误。
这个命令给了我错误:
bcdedit /copy {current} /d "mySSD"
Run Code Online (Sandbox Code Playgroud)
然后我跑去bcdedit /v看identifier'sGUID。这个命令也给了我同样的错误:
bcdedit /copy {c562ef5b-d0f6-11e8-bfb5-e86a64139893} /d "mySSD"
Run Code Online (Sandbox Code Playgroud)
错误:
The copy command specified is not valid.
Run "bcdedit /?" for command line assistance.
The parameter is incorrect.
Run Code Online (Sandbox Code Playgroud)
我应该怎么办?
这是输出结果bcdedit /v
Windows Boot Manager
--------------------
identifier {9dea862c-5cdd-4e70-accb-f32b344d4795}
device partition=\Device\HarddiskVolume1
path \EFI\Microsoft\Boot\bootmgfw.efi
description Windows Boot Manager
locale en-US
inherit {7ea2e1ac-2e61-4728-aaab-896d9d0a9f0e}
default {c562ef5b-d0f6-11e8-bfb5-e86a64139893}
resumeobject {c562ef5a-d0f6-11e8-bfb5-e86a64139893}
displayorder {c562ef5b-d0f6-11e8-bfb5-e86a64139893}
toolsdisplayorder {b2721d73-1db4-4c62-bf7b-c548a880142d}
timeout 0
Windows Boot Loader
-------------------
identifier {c562ef5b-d0f6-11e8-bfb5-e86a64139893} …Run Code Online (Sandbox Code Playgroud) 要在 Windows 7 64 位中禁用 KMCS,有什么区别
加载未签名的驱动程序是两者都必需还是其中之一?
感谢您的帮助 - 丹尼尔
如何使用bcdedit. 例如,我尝试了以下步骤,但未添加启动项。
bcdedit /create /d "LinuxLoader" /application osloader
Run Code Online (Sandbox Code Playgroud)
这将返回一个新的 guid(比如 newguid)
bcdedit /set {newguid} device partition=S:
bcdedit /set {newguid} path \boot\efi\bootx64.efi
bcdedit /set {fwbootmgr} displayorder {newguid} /addfirst
Run Code Online (Sandbox Code Playgroud)
提前致谢。
使用ImageX和WIM重建HDD后,BCD有时会损坏.因此,我需要从命令提示符中无人值守的脚本重建BCD.
手动输入时,以下代码执行此任务.我需要帮助来自动化它(请参阅下面的代码示例):
bootrec.exe /fixmbr
bootsect.exe /nt60 all /force
attrib -h -s C:\boot\BCD
del C:\boot\BCD
bcdedit.exe /createstore c:\boot\bcd.temp
bcdedit.exe /store c:\boot\bcd.temp /create {bootmgr} /d "Windows Boot Manager"
bcdedit.exe /import c:\boot\bcd.temp
bcdedit.exe /set {bootmgr} device partition=C:
bcdedit.exe /timeout 10
attrib -h -s C:\boot\bcd.temp
del c:\boot\bcd.temp
bcdedit.exe /create /d "Microsoft Windows" /application osloader
bcdedit.exe /set {GUID} device partition=C:
bcdedit.exe /set {GUID} osdevice partition=C:
bcdedit.exe /set {GUID} path \Windows\system32\winload.exe
bcdedit.exe /set {GUID} systemroot \Windows
bcdedit.exe /displayorder {GUID}
Run Code Online (Sandbox Code Playgroud)
如上所述,我需要在无人参与的命令提示符下运行它.第6个最后一个语句"bcdedit.exe/create/d"Microsoft Windows"/ application osloader"的输出是一个新创建的GUID.以下命令中需要此ID.
如何将这个新的GUID从bcdedit加载到我可以在以下代码中调用的变量?
最诚挚的问候Henrik V. …
我正在尝试在工作笔记本电脑上运行Oracle Virtual Box。我收到一条错误消息,说它无法运行,因为我正在运行Hyper-v。我正在尝试遵循Scott Hanselman的Blog中的说明,该说明过去曾在我的个人笔记本电脑上为我工作过,但存在类似问题。
我跑:
bcdedit /copy {current} /d "No Hyper V"
The copy command specified is not valid.
Run "bcdedit /?" for command line assistance.
The parameter is incorrect.
Run Code Online (Sandbox Code Playgroud)
我跑
bcdedit /copy {current} /d /?
This command creates a copy of the specified boot entry.
bcdedit [/store <filename>] /copy {<id>} /d <description>
<filename> Specifies the store to be used. If this option is not
specified, the system store is used. For more information,
run "bcdedit /? store". …Run Code Online (Sandbox Code Playgroud) 我需要能够使用c#从引导配置数据存储中访问当前运行的Windows安装程序的标识符GUID.它可以从运行的命令行返回:
bcdedit /enum {current} /v
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是在c#中,如果我尝试直接运行此命令(即使程序以管理员身份运行),我被告知bcdedit不存在.我正在使用:
ProcessStartInfo procStartInfo = new ProcessStartInfo("bcdedit.exe", "/enum {current} /v");
Run Code Online (Sandbox Code Playgroud)
我研究的另一件事是使用WMI,但我必须这样做的唯一参考是http://msdn.microsoft.com/en-us/library/windows/desktop/aa362673(v=vs.85).aspx这不是很有帮助.
最好的解决方案是,如果我不必使用bcdedit,而是可以使用本机WMI类.如何使用C#找到当前的Windows Boot Loader标识符?
所以我可以在powershell脚本中编写bcd命令,就像我在cmd提示符中一样,例如:
bcdedit /default '{current}'
Run Code Online (Sandbox Code Playgroud)
但是我需要一个执行此操作的脚本:
bcdedit /default '{current}'
bcdedit /set '{otherboot}' description "my description"
Run Code Online (Sandbox Code Playgroud)
如果它没有这样做,那将是另一种方式:
bcdedit /default '{otherboot}'
bcdedit /set '{current}' description "my description"
Run Code Online (Sandbox Code Playgroud)
我需要做的是在powershell中找到其他启动的标识符,我不知道如何.所有谷歌搜索都说这样做:
$bcdStore=gwmi -name root\wmi -list bcdstore -enableall
$bcdStore|gm
$result=$bcdStore.OpenStore("") # can also use explicit file name.
$store=$result.Store
Run Code Online (Sandbox Code Playgroud)
但我不知道如何使用它,这似乎有点太复杂.我的意思是应该有一个更简单的方法......不是吗?
我正在创建一个应用程序来分析启动配置数据(BCD)中的条目。
我尝试过使用 PowerShell,但它似乎没有提供任何 cmdlet 来处理它。因此,我又回到了 .NET,特别是 C#。
我想要有东西像这样获取 BCD 条目
var entries = bcd.GetEntries();
Run Code Online (Sandbox Code Playgroud)
条目是IList<BcdEntry>
class BcdEntry
{
public string Name {get; set; }
IDictionary<string, IList<string>> Properties { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
问题是我不知道如何获取条目。调用 BCDEdit 是一种可能性,但它需要解析命令的输出,这是一项繁琐的任务。
我希望你能为我的问题想出一个解决方案。
我需要在安全模式下重新启动后运行一次进程,该进程是这样的:
\n\nbcdedit.exe /import "%WINDIR%\\Restore BootLoader Settings.bcd"\nRun Code Online (Sandbox Code Playgroud)\n\n我尝试使用 RunOnce 密钥,但我注意到密钥不会在安全模式启动下运行,所以...是否存在其他方式在安全模式启动下运行该死的进程?
\n\n更明确地说,这就是我想要做的:
\n\n在正常模式或任何其他模式下,我导出所有引导加载程序条目的当前设置。
然后我更改当前引导加载程序条目的一些参数,然后重置电脑。
这就是问题所在,例如,当在安全模式下再次登录 Windows 时,我需要在新更改之前恢复(导入)设置,以便在重置计算机时不再以安全模式启动。
我怎样才能做到这一点?
\n\n这是我的vbs脚本:
\n\n\' Restart in Safe Mode\n\' By Elektro H@cker\n\nIf Not Msgbox( _\n "\xc2\xbfSeguro que quieres reiniciar el equipo?", _\n 4 or 48, _\n "Reiniciar en Modo Seguro..." _\n ) = vbNo _\nThen\n\nSet wshShell = WScript.CreateObject("WScript.Shell")\n\nTempFile = """" & wshShell.ExpandEnvironmentStrings("%WINDIR%") & "\\" & "Bcdedit settings.bcd" & """"\n\nwshShell.Run "bcdedit /export " & TempFile, 0, True\nwshShell.Run …Run Code Online (Sandbox Code Playgroud) 为什么我不能bcdedit在PowerShell中编辑描述字段?
例如,在cmd.exe以下命令中:
bcdedit /set {GUID} description "OS2"
Run Code Online (Sandbox Code Playgroud)
成功完成,更改指定GUID的描述字段,但是当我从Powershell执行相同操作时,我收到以下错误:
The set command specified is not valid.
Run "bcdedit /?" for command line assistance.
The parameter is incorrect.
Run Code Online (Sandbox Code Playgroud)
谁可以给我解释一下这个?
当我尝试在CMD bcdedit命令运行时工作.当我尝试在PowerShell中运行它时,我得到了这个:The term 'bcdedit' is not recognized as the name of a cmdlet
但是bcdedit在PowerShell中正常工作的手册和教程中.为什么我的PowerShell无法识别bcdedit?
系统:Windows 7 x64 SP3