天道酬勤,学无止境

bcdstore

使用 C# BCD WMI 提供程序安全启动 Windows(Use C# BCD WMI Provider to SafeBoot Windows)

问题 我在网上搜索有关如何仅使用 C# 安全启动到 Windows 的解决方案。 从 Vista 及以上版本开始,安全启动是使用 BCD 控制的。 当然你可以使用命令行工具“bcdedit”: bcdedit /set {current} safeboot Minimal 但是我不想使用这种方法。 所以我的问题是: 如何仅使用 C# 重新启动到安全模式? 我已经看过this SO post,它让我开始了。 但我仍然缺少这个拼图的碎片。 任何帮助是极大的赞赏。 =) BCD WMI Provider Reference 帮助不大。 回答1 我在 C# 中编写了以下代码,它应该允许您设置安全启动值并删除该值: using System; using System.Collections.Generic; using System.Linq; using System.Management; using System.Text; using System.Threading.Tasks; namespace EditBcdStore { public class BcdStoreAccessor { public const int BcdOSLoaderInteger_SafeBoot = 0x25000080; public enum BcdLibrary_SafeBoot {

2021-09-01 11:38:18    分类:技术分享    c#   wmi   bcd   safe-mode   bcdstore

Use C# BCD WMI Provider to SafeBoot Windows

I have scoured the web looking for solutions on how to SafeBoot into Windows using only C#. Since Vista and above, safe booting is controlled using BCD. Ofcourse you could use the commandline tool "bcdedit": bcdedit /set {current} safeboot Minimal However I do not want to use this approach. So my question is: How do I reboot into safe mode using only C#? I have already looked at this SO post, which has got me started. But I'm still missing pieces to this puzzle. Any help is greatly appreciated. =) BCD WMI Provider Reference is of little help.

2021-07-09 21:52:46    分类:问答    c#   wmi   bcd   safe-mode   bcdstore

Access the Windows 7 Boot Configuration Data using C#

I need to be able to access the identifier GUID of the current running installation of Windows from the Boot Configuration Data Store using c#. It can be returned from the command line running: bcdedit /enum {current} /v The problem I have is that in c# if I try to directly run this command (even though the program is running as Administrator) I'm told that bcdedit does not exist. I'm using: ProcessStartInfo procStartInfo = new ProcessStartInfo("bcdedit.exe", "/enum {current} /v"); The other thing that I have researched is using WMI but the only reference I have to doing so is http://msdn

2021-04-30 18:27:04    分类:问答    c#   windows-7   wmi   bcdedit   bcdstore