This is a way to get hard disk serial number using console command from matlab:
Copy%// 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};
The same for the processor id:
Copy%// 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};
It's all about using console command wmic + [hardware name] + get + [attributename]
and if you want to know the whole attributes available for some device you can use get in your command without naming any attribute, Example:
Copycommand = 'wmic csproduct get'
that will get all available attributes of your machine as a product and its values.
Answer from Sameh K. Mohamed on Stack OverflowThis is a way to get hard disk serial number using console command from matlab:
Copy%// 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};
The same for the processor id:
Copy%// 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};
It's all about using console command wmic + [hardware name] + get + [attributename]
and if you want to know the whole attributes available for some device you can use get in your command without naming any attribute, Example:
Copycommand = 'wmic csproduct get'
that will get all available attributes of your machine as a product and its values.
I can add some more commands here:
Copycmd='wmic baseboard get serialnumber';
[~, result] = system(cmd);
%// Extract first processor id
fields = textscan( result, '%s', 'Delimiter', '\n' );
fields = strtrim(fields{1});
baseboardSN = fields{2};
You can also try the following:
wmic csproduct get name wmic bios get serialnumber wmic csproduct get UUID