This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Hard disk serial number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Hard disk serial number" Watch "Hard disk serial number" New topic

Hard disk serial number

siddhu Math
Ranch Hand

Joined: Aug 10, 2006
Posts: 46
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 ...

Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13868

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.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Joanne Neal

Joined: Aug 05, 2005
Posts: 3165
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("") 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.

I agree. Here's the link:
subject: Hard disk serial number
Similar Threads
To find the hard disk serial number
how to get hard disk serial number using java
How to read hard disk physical serial number?
Get hard disk serial key
Get Serial number of exernal hard disk/Thumbdrive using java code &work for both linux and windows