【问题标题】:How can I get processor and hard disk manufacturing serial numbers and ids?如何获取处理器和硬盘制造序列号和 ID?
【发布时间】:2013-01-01 09:02:05
【问题描述】:

如何使用 Matlab 获取以下硬件属性?

  • 主板制造序列号
  • 处理器 ID
  • 处理器制造序列号
  • 硬盘 ID
  • 硬盘制造序列号

是否有任何函数或类负责检测其他机器硬件组件属性的属性?

我知道可以使用系统或控制台命令来完成,但我不知道如何。但是,我更喜欢两种方式,一种使用 Windows 控制台命令,另一种不使用它。

【问题讨论】:

  • 我建议研究this tool的实现...也许它可以提供帮助。
  • 这是有用的代码,谢谢。

标签: windows matlab hardware


【解决方案1】:

这是一种使用matlab控制台命令获取硬盘序列号的方法:

%// Get hard disk serial using windows console command
cmd         = 'wmic diskdrive get SerialNumber';
[~, result] = system(cmd);
%// Extract first hard disk serial number
fields      = textscan( result, '%s', 'Delimiter', '\n' );
fields      = strtrim(fields{1});
serialNo    = fields{2};

处理器 ID 相同:

%// Get processor id using windows console command
cmd           = 'wmic cpu get ProcessorId';
[~, result]   = system(cmd);    
%// Extract first processor id
fields        = textscan( result, '%s', 'Delimiter', '\n' ); 
fields        = strtrim(fields{1});
processorId   = fields{2};

这都是关于使用控制台命令wmic + [hardware name] + get + [attributename] 如果您想知道某些设备可用的全部属性,您可以在命令中使用get 而无需命名任何属性,例如:

command = 'wmic csproduct get'

这将获取您机器的所有可用属性作为产品及其值。

【讨论】:

  • +1:我自己没有时间尝试,但我觉得 WMI 是正确的方向 :)
  • 您的链接真的很有帮助,非常感谢,是您解决了这个问题:D。
  • 很高兴为您提供帮助。实际上,真正解决它的是该工具的制造商 :) P.S: 我建议您将自己的答案标记为已接受。
  • 什么是差异。 csproduct identifyongnumber 和 bios 序列号总是一样的吗?
  • Csproduct UUID 总是一样?
【解决方案2】:

我可以在这里添加更多命令:

cmd='wmic baseboard get serialnumber';
[~, result]   = system(cmd);    
%// Extract first processor id
fields        = textscan( result, '%s', 'Delimiter', '\n' ); 
fields        = strtrim(fields{1});
baseboardSN   = fields{2};

您还可以尝试以下方法:

wmic csproduct 获取名称 wmic bios获取序列号 wmic csproduct 获取 UUID

【讨论】:

    猜你喜欢
    • 2014-01-11
    • 1970-01-01
    • 2011-05-04
    • 2010-12-06
    • 2016-08-28
    • 1970-01-01
    • 2015-04-27
    • 2011-05-10
    • 2010-11-24
    相关资源
    最近更新 更多