Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to retrieve HardDisk Address

Posted on 2004-09-15
9
Medium Priority
?
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
9 Comments
 
LVL 5

Accepted Solution

by:
ITcrow earned 500 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 59

Expert Comment

by:Julian Hansen
ID: 12073158
Try the GetVolumeInformation API call
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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
 
LVL 59

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 59

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 59

Expert Comment

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

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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 …
Progress

604 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