bcdedit

Unable to edit with bcdedit filelds in powershell - cmd.exe command line fails

泪湿孤枕 提交于 2019-12-23 03:19:30
问题 Why can't I edit the description field using bcdedit in PowerShell? For example, in cmd.exe the following command: bcdedit /set {GUID} description "OS2" completes successfully, changing the description field for the specified GUID, but when I do the same thing from Powershell, I get the following error: The set command specified is not valid. Run "bcdedit /?" for command line assistance. The parameter is incorrect. Can someone explain this to me? 回答1: To pass a value enclosed in {...} as a

Access the Windows 7 Boot Configuration Data using C#

蓝咒 提交于 2019-12-19 04:23:24
问题 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

Access the Windows 7 Boot Configuration Data using C#

孤者浪人 提交于 2019-12-01 00:19:42
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