Solved

How to retrieve HardDisk Address

Posted on 2004-09-15
9
222 Views
Last Modified: 2010-04-17
i want to get the address of my hard disk attatched with my computer,
like i get the MAC Address.
Is there any way,
i would be grateful

ifza
0
Comment
Question by:ifzah
  • 4
  • 4
9 Comments
 
LVL 5

Accepted Solution

by:
ITcrow earned 125 total points
ID: 12073016
Go to Command Prompt:
Start => Run => cmd

On the prompt type:
dir

Result has your disk serial number.

Although this number is not like MAC address, it doesn't change after creating the partition and formatting a drive. This number is generated every time you format a drive. It gets calculated based on date and time and is stored on drive's boot sector.
0
 

Author Comment

by:ifzah
ID: 12073119
How to get programatically , in C++
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 12073158
Try the GetVolumeInformation API call
0
 

Author Comment

by:ifzah
ID: 12073726
can u write some code please, how to use it..
in order to get serial number.
I would be grateful..
ifza
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 52

Expert Comment

by:Julian Hansen
ID: 12073767
This should do it

#include <windows.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
      char szBuffer[256] ;
      char szBuffer2[256] ;
      DWORD dwSerial, dwMax, dwFlags ;

      dwSerial = 0 ;
      GetVolumeInformation ( "C:\\", szBuffer, 256, &dwSerial, &dwMax, &dwFlags, szBuffer2, 256 ) ;

      printf ( "Serial number: %d\n", dwSerial ) ;

      return 0 ;
}
0
 

Author Comment

by:ifzah
ID: 12073798
i am grateful
thanks
ifza
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 12073931
Just as a matter of interest - why did you ask for source code and then allocate points to the answer on how to get the serial number from the command line? I am very confused.
0
 

Author Comment

by:ifzah
ID: 12074393
oh sorry julian
i thought, that it was u, who answered me from beginning to end.
i am really sorry.
please forgive me. i did't see ...
really i am sorry..
these points were for u only............

please forgive me..

take care and lots of love in helping me...
0
 
LVL 52

Expert Comment

by:Julian Hansen
ID: 12074438
you are forgiven ... mostly ;)

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now