Solved

HDD Serial Number

Posted on 1998-12-16
3
475 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
[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
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
jhurst earned 50 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

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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…
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

617 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