home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR9
/
WDOS0793.ZIP
/
ZOLMAN.ZIP
/
SETLABEL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-05-12
|
1KB
|
44 lines
/*
SetLabel.C - Set Disk Volume Label for DOS
Copyright (c) Smuth Nakpansua, 1992, 1993. All rights reserved.
Create date: Nov 25, 1992
Last Update: March 23, 1993
Compile: cl setlabel.c dsklabel.obj (Microsoft)
bcc setlabel.c dsklabel.obj (Borland)
*/
#include <dos.h>
#include <io.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dsklabel.h"
int main(int argc, char **argv)
{
int drive;
printf("SetLabel - Set Label Utility\n"
"Copyright (c) Smuth Nakpansua, 1992, 1993. All rights reserved\n\n");
if (argc != 3) {
printf("usage: DSKLABEL <drive:> <string-label>\n");
return(-1);
} /* if */
drive = *argv[1];
drive |= ('A' <= drive && drive <= 'Z') ? 0x20 : 0;
drive -= ('a' - 1);
if (strcmp(argv[1]+1, ":") != 0) {
printf("invalid drive: %s\n", argv[1]);
return(-1);
} /* if */
if (_DosSetVolumeLabel(drive, argv[2]))
printf("Could not set volume label\n");
return(0);
} /* eof: main() */
/* eof: setlabel.c */