This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hard disk serial number  RSS feed

 
siddhu Math
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hay Dudes

Its very urgent for me i wann retrieve hard disk serial number, can any oe provide me or suggest me how to get. i do not want to use jni to do this ...

Thanks
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15860
80
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing in the standard Java API to do something very platform-specific like this, so you won't be able to do this without some native code and using JNI to call the native code.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could write a non-Java application that gets the required information (you will need a version of the program for each platform you intend to run your Java program on) and then use Runtime.exec() or ProcessBuilder to call the correct program for the OS you are running on (use System.getProperty("os.name") to find this).
As long as all the programs return the information in the same format, you can use common code to parse the result.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!