使用wmic访问Bcd时失败

时间:2012-05-10 20:14:51

标签: wmic bcdstore

当我尝试使用wmic访问BcdStore类的EnumerateObjects方法时出现错误。

我最初运行GetSystemDisk方法,看看我可以访问BcdStore(见下文)。这很好。

  

__ _ __ _ __ _ __ _ __ cmd窗口输出开始 __ _ __ < EM> _ __ _ __ _ __ _ ___

     

C:&gt; wmic / namespace:\ root \ wmi class BcdStore call GetSystemDisk

     

执行(BcdStore) - &gt; GetSystemDisk()

     

方法执行成功。

     

输出参数:

     

__PARAMETERS

的实例      

{

    Disk = "\\Device\\Harddisk0\\DR0";

    ReturnValue = TRUE;
     

};

     

__ _ __ _ __ _ __ _ __ cmd窗口输出结束 __ _ __ < EM> _ __ _ __ _ __ _ ___

然后我运行了EnumerateObjects方法,但是失败了,请看下面的内容。不同的版本只是如何将参数传递给方法的不同变体,但这没有用。

  

__ _ __ _ __ _ __ _ __ cmd窗口输出开始 __ _ __ < EM> _ __ _ __ _ __ _ ___

     

C:&gt; wmic / namespace:\ root \ wmi class BcdStore call EnumerateObjects 10200003

     

执行(BcdStore) - &gt; EnumerateObjects()

     

ERROR:

     

描述=方法参数无效

     

C:&gt; wmic / namespace:\ root \ wmi class BcdStore call EnumerateObjects Type = 10200003

     

执行(BcdStore) - &gt; EnumerateObjects()

     

ERROR:

     

描述=方法参数无效

     

C:&gt; wmic / namespace:\ root \ wmi class BcdStore call EnumerateObjects Type =&#34; H10200003&#34;

     

ERROR:

     

描述=类型不匹配。

     

C:&gt; wmic / namespace:\ root \ wmi class BcdStore call EnumerateObjects 0x10200003

     

ERROR:

     

描述=类型不匹配。

     

__ _ __ _ __ _ __ _ __ cmd窗口输出结束 __ _ __ < EM> _ __ _ __ _ __ _ ___

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:0)

这不是一个答案,因为我不确定你真正理解你想做什么,但它可以解释你为什么做不起作用。

以下是有效的,因为GetSystemDisk是类BcdStore的静态方法:

wmic /namespace:\root\wmi class BcdStore call GetSystemDisk

正如您在 WMI Cim studio 的方法限定符中所看到的那样:

enter image description here

但是 EnumerateObjects是类BcdStore的实例方法,因此您无法从类本身调用它,您必须从实例中调用它。 WMI对象浏览器在我的W2K8R2上没有显示BcdStore类的实例。

enter image description here