Re: getting hardware data
- Posted by jimcbrown (admin) May 23, 2012
- 1617 views
If such a routine would be of general value to the programming community, then that would be a different matter. For example, and I really don't know the answer to this, is this routine part of other languages' Standard Library?
It's not in the Perl stdlib. It can be done, but it requires wrapping OLE from Perl and so on: http://www.perlmonks.org/?node_id=340212
A similar process is required to do this in Delphi: http://theroadtodelphi.wordpress.com/2012/04/09/how-obtain-the-source-of-the-wmi-data/
It's not in the Python stdlib, though someone wrote a 3rd party module for WMI: http://timgolden.me.uk/python/wmi/index.html
I can't find any information on how to do it in Ruby at all.
It seems that this can't be done in Java, period. If you want to use that informatino in Java code, you'll need to use JNI or call an external program to obtain it: http://www.coderanch.com/t/532384/java/java/hard-disk-serial-number-java
Visual Basic makes it easy to call WMI, but this still isn't in the stdlib: http://forums.codeguru.com/showthread.php?t=492661
VB provides more than one way to do this, however: http://www.vbgold.com/vb-projects/disk-serial-number.shtml Calling even this method a stdlib method seems like a bit of a stretch to me.