Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 233
  • Last Modified:

How to retrieve HardDisk Address

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
ifzah
Asked:
ifzah
  • 4
  • 4
1 Solution
 
ITcrowCommented:
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
 
ifzahAuthor Commented:
How to get programatically , in C++
0
 
Julian HansenCommented:
Try the GetVolumeInformation API call
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ifzahAuthor Commented:
can u write some code please, how to use it..
in order to get serial number.
I would be grateful..
ifza
0
 
Julian HansenCommented:
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
 
ifzahAuthor Commented:
i am grateful
thanks
ifza
0
 
Julian HansenCommented:
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
 
ifzahAuthor Commented:
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
 
Julian HansenCommented:
you are forgiven ... mostly ;)

0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now