• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 529
  • Last Modified:

Hard Disk Label prob

Somhow the PC Label has changed such that it contains lower case letters. Due to this,simply typing "LABEL ANYLABEL"
will not fix the problem.ie it wont change the LABEL
I know I can fix it with Norton by editing the location of the drive where the LABEL is stored. But do not want to do this. What I want to know is how to do this using DOS DEBUG or using another method such as DOS Bios calls thru C.
Thnx in Adnavce Sean
0
sokeeffe
Asked:
sokeeffe
  • 11
  • 5
  • 5
  • +7
1 Solution
 
mixelogjCommented:
right click in your hard drive in My computer ( win ) . there you can see the label , just change it...
0
 
sokeeffeAuthor Commented:
OK.This is not as simple as you might think. OK. I am talking about How the label looks thru Dos. I know Win 95 keeps the Label as you enter it including Small and Caps..But if you label your Hard drive in Win 95 in all smalls then open a dos window and type LABEl...Hey presto you notice that it is all in CAPS...
You will never see a label in DOS with Small letters. If you do then the label was created illegall and you cannot undo it..Hence My problem. The LABEL in dos reads Small letters and cannot be correct easily. If you attempt to re-label it in DOS it comes up with Cannot make dirctory entry. I dont care what it looks like in WIN95. That is not a true reflection of what is on the LABEL.
0
 
rmarottaCommented:
sokeefe,
At the prompt in the label command, I have successfully entered special characters using ascii character code number while holding the ALT key.

For example: ALT + 128 = Ç.

I hope this helps.
Regards,
Ralph
0
Improved Protection from Phishing Attacks

WatchGuard DNSWatch reduces malware infections by detecting and blocking malicious DNS requests, improving your ability to protect employees from phishing attacks. Learn more about our newest service included in Total Security Suite today!

 
sokeeffeAuthor Commented:
Sorry Ralph that doesnt work..Thanks anyway.
I am not too sure how the small letters get put in the label, and why this stops further Labels being created/changed.
but more to the point I am trying to be able to enter a Label after this rather than figure out how it happens, although that would help in understaning how it can be solved.
I tried your effort and that did not seem to work. In respect to creating an Illegal Label.
0
 
rmarottaCommented:
Sorry - bad example.
You must first determine the ascii code number for the characters that you want to insert, then use ALT key + the number for each.
You can find some decimal symbol codes here:
http://www.uni-greifswald.de/~werner/tutorial/url/ascii.htm
I hope this helps.
Ralph

0
 
sokeeffeAuthor Commented:
Thanks Ralph again..But I knew what u meant. U meant the dos Codes for the letters..Ie small d is ALT - 100
Thxs anyway for the help...

0
 
rmarottaCommented:
Are you aware the the label can contain only eleven characters?
If so, I'm not sure what you're trying to do.......
Please explain a little more.
Ralph

0
 
sokeeffeAuthor Commented:
Ok I deal with Laptops at work. We have seen some that have inadvertanly gotton their Labels changed incorrectly to Labels that contain Lower case Letters ( within the 11 char limit).
Software is setup on these Laptops regurally. And the software type that is put onto the Laptop is determined by the Label on The PC. Now whne the Software is put on ( which is done by anoher program) the Label is read. If the Label is is incorrect it is re-labeled. There are cases that the Label acnnot be changed and the Laptop is replaced ( Alot of overhead). Investigation into this problem tells us that the Labels are inadvertanly changed sometimes somehow by the program that sets up the Laptop. Now manually reading The Label shows us that it has lower case letters. (Which in Normal DOS operation is not possible). As we know when changing the Lable in Dos all letters are Converted to uppercase and the LABEL is held with all Uppercase letters. If you ever see the scenario that the LAbel contains lower case letters you will not be able to change it just by using the DOS Label Command. It returns an error message saying "Cannot create Directory entry".. Which tranlates as DOS read the LAbel saw it as being an illegal Lable and cannot create the New LABEL to the Location specified(Directory entry).
Now in this situation if you use Norton Editor and go to the LOcation where the LAbel is stored (Or just do a search for the Label Tilte) You will se that it does contain lower case letters. Now the fix can be just to edit this and put in Upper case leters and hey presto its fixed and you can continue to change LABELS as normal thu DOS. BUT I DO NOT want to use Norton.
As this involves loading it on to the PC's adnd also due to other reasons.
Now I know it is possible to use DEBUG tool in Dos to do the same thing as Norton Editor. And to even Automate it using a DOS Debug Script. But I do not have this information. There is also a way I think to do this by using a C program that calls the DOS BIOS functions to Change the LABEl.
PHEWWWW I hope that clarifys the situation further.
REGARDS Sean
0
 
rmarottaCommented:
Ok Sean, NOW, I understand!........
I've seen the debug script before.  Of course, I don't remember it, or where, but I'll help you look for something on it.
I can't help you with a C program, though.  Perhaps someone else here can???
Regards,
Ralph

0
 
carmineCommented:
Can you use the LABEL command without defining a new label to erase the corrupt one?
0
 
carmineCommented:
Here is some C code for changing a Volume Label using BIOS calls.

http://support.microsoft.com/support/kb/articles/q58/6/50.asp
0
 
sokeeffeAuthor Commented:
NO the use of the LABEL command as explained earlier does not work.
0
 
snoeglerCommented:
Okay i hope this one helps.
Because this i have compiled this with MSVC 1.5 - supporting pure DOS executables - i do
think that the source code of my prog won't help you - so post me a mail to
alexander.berthold@rol3.com and i will send you "rmlabel.exe"(6519 bytes) which removes
the volume label from any drive you specify. You also can download it from
http://absd.hypermart.net/rmlabel.exe(caution: filename is case sensitive - use lowercase letters).

<note: this is basically what carmine gave as answer converted to C code and compiled
  - perhaps you open up two dummy questions and divide the points, if you like>

#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <ctype.h>

unsigned char myfcb[8+37+11+1];
unsigned char dfault[]="*       *  ";

void newVol(int Drive, char* volname)
{
    _asm {
        mov bx,Drive
        mov myfcb+7,bl
        mov ax,ds
        mov es,ax
        cld
        mov cx,11 ;maxlen
        mov si,offset dfault
        mov di,offset myfcb+8
        rep movsb
        mov dx,offset myfcb
        mov ah,13h
        int 21h
        mov cx,11 ;maxlen
        mov si,volname
        mov di,offset myfcb+8
        rep movsb
        mov dx,offset myfcb
        mov ah,16h
        int 21h
        mov dx,offset myfcb
        mov ah,10h
        int 21h
        mov ah,0
    }
}

void fail()
{
  puts("usage: <rmlabel [drive]:>");
  puts("for ex.: rmlabel c:");
  puts("");
  puts("Deletes the volume label for the specified drive");
  exit(0);
}

void main(int argc,char *argv[])
{
  char ch;
  int i;
  for(i=0;i<(8+37+11);i++) myfcb[i]=' ';
  myfcb[0]=255;
  myfcb[1]=0;
  myfcb[2]=0;
  myfcb[3]=0;
  myfcb[4]=0;
  myfcb[5]=0;
  myfcb[6]=8;
  myfcb[7]=1;

  if(argc!=2) fail();
  ch=argv[1][0];
  ch=toupper(ch);
  if(ch<='A' || ch>='Z') fail();
  newVol(ch-'A'+1,"                ");
}

0
 
sokeeffeAuthor Commented:
OK..I Think this will probably go to Carmine or Snoegler.
I tried to run rmlabel.exe But it always says
"Program too big to Fit in Memory" Both in Windows Dos and in Dos only.
Sorry Carmine earlier I did not read your Proposed answer I read the Comment and rejected.
Ok what I need is the compiled program above that will run on DOS
And that will allow me to enter the new Lable (even with Lower case letters) So I can proove that it works....
Thanks in advance
Sean
0
 
snoeglerCommented:
Sorry i uploaded it in ASCII-mode - the code was currupted. Just download it again, it will work now(http://absd.hypermart.net/rmlabel.exe)
0
 
sokeeffeAuthor Commented:
Thanks Snoegler...But what I am looking from the source is not that it just deletes the label if it was corrupt(ie small letters) but  ALSO to be able to label the Disk as well... Even Lable it incorrectly ( this way I know that the prog is working correctly...)
0
 
snoeglerCommented:
Sorry if i have mistaken you but you wanted to kill a label which contained lowercase letters,
and then reset it to a label containing (legal) uppercase ones, so i thought you might want to
delete the label using rmlabel and then invoking the DOS LABEL command to set it to the
(legal) label you want it to be.

0
 
busukaCommented:
I'm afraid that DOS label will not work. It'll render your label
to smth. like "At_" right ? Also I'm not sure that third-party
DOS 7.0 based labeler exist. IMO, volume label is 0-length file
in root directory with attribute Vol, but Win95's LFN changed life
slightly :)
0
 
MasseyMCommented:
Are your laptops DELL?  When I worked at GE, we had a horrible virus destroy our HD's... Rather than lowercase letters, we have random ascii characters... We couldn't even FDisk the drives... They had to be destroyed.... PS I don't think this is your problem, but thought I would ask...


0
 
carmineCommented:
MasseyM, this is normal behaviour if you are running Win95 and you create a file with a long file name in the root directory.  It is a documented problem on the MS web site.  Basically the set of attributes used by the volume label file can be created by the Win95 LFN extended entries.  FDisk then refuses to let you repartition because you cannot enter the invalid label.
You can get around this by erasing the first sector of the disk and starting again.
Moral: Don't create long file names in root directories.
0
 
rmarottaCommented:
carmine,
>  "It is a documented problem on the MS web site."

Would you mind sharing the URL of that documentation?
Regards,
Ralph

0
 
tuviCommented:
This usually happens when you don't label your hard drive first before installing win95. sokeeffe, is your label now something likes "Ag"? It happens to me all the time.
0
 
duneramCommented:
I used to run into this problem with early versions of the EDI installer.  The installer permitted lowercase names, but my early dos didn't, so it could never find my floppy disks
0
 
sokeeffeAuthor Commented:
OK so far I still have not been able to change the illegal Label even with all of the information above. Ie the rmlabel.exe does not work.
OK the most recent Laptops with this prob Both had labels of
"AP" . Dong a simple LABEL in DOS just gave no result (No error)
C:\>label
Volume in drive C is AP
Volume Serial Number is 4041-19DB
Volume Label (11 characters, ENTER for none)?

Delete current volume label (Y/N)? y
C:\>
Doing a LABEL c:name gives the following
C:\>label c:HP-OMNI

Cannot make directory entry
C:\>
DOS Version is MS-DOS Version 6.20 ( So that rules out the possibilty that it was due to having been loaded with Win 95 without a LABEL.)
Still Looking for a method to resolve this issue simply and easily
Thanks Sean.
PS sorry for not responding in a cpl of days but I had a few days off.
 
0
 
duneramCommented:
A nasty way is to do a FDISK  (delete the partition, then recreate the partition without a label.

If you have data you can't lose though, you risk losing it.  However.  Several years ago, I had to fdisk my drive to recover the FAT, and when I was all done, all of my original data was still there.

But I say there is risk with this method.
0
 
sokeeffeAuthor Commented:
OK so far I still have not been able to change the illegal Label even with all of the information above. Ie the rmlabel.exe does not work.
OK the most recent Laptops with this prob Both had labels of
"AP" . Dong a simple LABEL in DOS just gave no result (No error)
C:\>label
Volume in drive C is AP
Volume Serial Number is 4041-19DB
Volume Label (11 characters, ENTER for none)?

Delete current volume label (Y/N)? y
C:\>
Doing a LABEL c:name gives the following
C:\>label c:HP-OMNI

Cannot make directory entry
C:\>
DOS Version is MS-DOS Version 6.20 ( So that rules out the possibilty that it was due to having been loaded with Win 95 without a LABEL.)
Still Looking for a method to resolve this issue simply and easily
Thanks Sean.
PS sorry for not responding in a cpl of days but I had a few days off.
 
0
 
newexpertCommented:
OK, here's how to do it in debug.  Be very careful.

C:>DEBUG                       * start debug
-l 100 2 0 1                   * this loads the boot sector of
                               * the c: drive.  If you want d:
                               * drive use "l 100 3 0 1".
                               *
                               * Now the boot sector is loaded.
-d                             * This command will show you
                               * the 1st 8 lines of what's been
                               * loaded.
-e 147                         * Now you are editing location
                               * 147 (which is your label, but
                               * please verify that).  Where
                               * the label is should be obvious.
                               * To turn a lower case letter
                               * to upper case all you need to
                               * do is subtract 2 from the 1st
                               * digit, ie 61 -> 41, 71 -> 51 etc
                               * When you are done press ENTER
-d 100                         * Display again just to make sure
                               * you've done it correctly.
-w 100 2 0 1                   * Write it back to disk.
-q                             * And you are done.
0
 
carmineCommented:
Newexpert, there's one slight snag with your solution.  The label is not just held in the header, there is a directory entry that also defines the label, the only way to find the location of this entry (it's variable) is by using FCBs.

It's because of this directory entry that Win95 can corrupt the label when using LFNs and then reverting to a version of DOS of 6.22 or earlier.

I'm getting a little lost on what has been tried and what hasn't!

sokeeffe, can you confirm that these laptops have had Win95 running on them?

Can you also confirm that you've tried booting from a DOS7.0 floppy (win95 recovery disk) and tried the DOS7 label command?
0
 
newexpertCommented:
Sorry, the solution I gave earlier was only partial.  There appears to be a volume entry in the ROOT directory listing that needed to be changed simultaneously.

If I assume you are using a FAT16 drive (Windows 95 original)
then the solution is to add the following steps in debug

c:\>debug
-l 100 2 0 1
                          * do as outlined in the solution.
                          * now before you quit debug, do
-l 0 2 100 7f             * This will load root directory
-s 0 ffff 61 62 63 64 65  * This will search for the label
                          * say the label was "abcde" (hex 61
                          * corresponds to 'a')
                          * This instruction should return
                          * an address say 1234:66dc
                          * if not please use command
                          * -l 0 2 180 7f
                          * -s 0 ffff 61 62 63 64 65
                          * to search in next $80 sectors
                          * repeat until you find it.
-d 1234:66dc              * display the label.  Check carefully
                          * If it is
                          * 61 62 63 64 65 20 20 20 20 20 20 28
                          * then you've got it.
-e 1234:66dc              * now edit it as before, turn the
                          * label into 41 42 43 44 45 20 ... 28
-d 1234:66dc              * display to make sure.
-w 0 2 100 7f             * Be very careful here!!!
                          * if you had used command
                          * -l 0 2 180 7f to load from disk.
                          * PLEASE USE -w 0 2 180 7f to write it
                          * back, otherwise you would be writing
                          * stuff into the wrong area and
                          * trashing your hard drive!!!
-q

If you were unfortunate enough to have a FAT32 Drive then locating the Root directory became very tedious.  You may start from sector $3F00 and start searching (that is -l 0 2 3F00 7f), until you find the label entry.  If that were the case you should consider using a disk utilty better than DOS's debug to do the job.

If you need help in debug just type ? then enter.

Using debug to solve the problem is not particularly easy.  So if you want to reject my answer please feel free to do so.
0
 
newexpertCommented:
Oh and thanks Carmine for the tip.
0
 
sokeeffeAuthor Commented:
OK...Sorry for not getting back aagin to quickly But I do have my days off.
Anyway..I have 2 Laptops at the moment that I will have in my posession tomorrow. They both are running Dos 6.22 and not Win95.
I think the Debug answer will work, but I wish to try it out tomorrow when the PC's arrive. Anyway if it does work the points Partially will go to Newexpert and the rest to Carmine. Thanks both of you for all the help so far that you have given.
Rgds Seán.

0
 
sokeeffeAuthor Commented:
Sorry just a point to note and could have been the reason the label has been corrupted.
These laptops could have had WIN95 on them at one stage and been downgraded to dos 6.22. But I cant say that for definite.
Hope that is a little clearer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 11
  • 5
  • 5
  • +7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now