Solved

How to retrieve HardDisk Address

Posted on 2004-09-15
9
221 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
Comment Utility
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
Comment Utility
How to get programatically , in C++
0
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
Try the GetVolumeInformation API call
0
 

Author Comment

by:ifzah
Comment Utility
can u write some code please, how to use it..
in order to get serial number.
I would be grateful..
ifza
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
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
Comment Utility
i am grateful
thanks
ifza
0
 
LVL 51

Expert Comment

by:Julian Hansen
Comment Utility
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
Comment Utility
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 51

Expert Comment

by:Julian Hansen
Comment Utility
you are forgiven ... mostly ;)

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This is about my first experience with programming Arduino.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

762 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

6 Experts available now in Live!

Get 1:1 Help Now