Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

HDD Serial Number

Posted on 1998-12-16
3
Medium Priority
?
489 Views
Last Modified: 2008-03-17
I need to make a programa for DOS in C in order to get hard disk's serial number or the MAC address (net card). I have to put it on the autoexec.bat so it has to work in MS-DOS. Please send code.
0
Comment
Question by:quique
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
jhurst earned 100 total points
ID: 1255197

  {FILE *fil;
  char str[100];
  system("vol  >temp.fil");   /* gets the label and serial number */
  fil=fopen("temp.fil","rt");   /* read what we made */
  while (fgets(str,90,fil))     /* get to the line we need */
    if (strstr(str,"Serial Number")) /* are we are at the serial number line? */
      break;                         /* yes */
  fclose(fil);                        /* done with it */
  unlink("temp.fil");             /* clean up after ourself */
  strcpy(str,strstr(str,"Serial Number")+17); /* just the serial number */

  /* we now have the serial number in str */
  }

0
 
LVL 1

Author Comment

by:quique
ID: 1255198
OK, but I need the serial number from the company who makes the hard disk.
0
 
LVL 1

Author Comment

by:quique
ID: 1255199
OK, but I need the serial number from the company who makes the hard disk, not the serial number from the formatting.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

916 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