Article View: comp.os.msdos.misc
Article #3868Retrieving a disk's LABEL (Was: Re: Help with UC2)
From: John Savage
Date: Mon, 26 Feb 1996 00:00
Date: Mon, 26 Feb 1996 00:00
33 lines
2066 bytes
2066 bytes
stephenb@nbnet.nb.ca writes: > Hi, I'm trying to make a batch file to get UC2 to make an archive using > the diskette's volume label as the archives file name. Is this possible? I know nothing about the particular archiver you discuss. But is it sufficient to have a .bat rename UC2's file? If so, make use of this batch file which sets an environment variable LABEL to the label string. DSKLABEL.BAT ------------ :: Usage example: DSKLABEL A: :: correctly reads separators in label provided they are single spaces @echo off echo set label=%%5>volume.bat echo :P>>volume.bat echo shift>>volume.bat echo if not "%%5"=="" set label=%%label%% %%5>>volume.bat echo if not "%%6"=="" goto P>>volume.bat dir %1 | find /i "Volume in drive" >tmp.bat call tmp del tmp.bat del volume.bat You now have an environment variable set to the 11-character (max) label of disk A (or "no label" where the disk lacks a label). You can use rename to set a filename to the first 8 letters of this string with a line just like this: RENAME somefilename %LABEL%.UC2 Is this what you wanted? Bear in mind that one can easily change a disk's label (and even its serial number) through software. -- John Savage koala@sydney.dialix.com.au
Technical Details
Message-ID:
<4gs1t2$rf7$1@sydney.DIALix.oz.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<312014C1.4145@nbnet.nb.ca>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d683,5d3fa1b575e33c90,start X-Google-Attributes: gid10d683,public X-Google-Thread: f53ba,5d3fa1b575e33c90,start X-Google-Attributes: gidf53ba,public X-Google-Thread: 104805,5d3fa1b575e33c90,start X-Google-Attributes: gid104805,public X-Google-Thread: f71eb,5d3fa1b575e33c90,start X-Google-Attributes: gidf71eb,public From: John Savage <koala@sydney.dialix.com.au> Subject: Retrieving a disk's LABEL (Was: Re: Help with UC2) Date: 1996/02/26 Message-ID: <4gs1t2$rf7$1@sydney.DIALix.oz.au> X-Deja-AN: 141166177 sender: koala@sydney.DIALix.oz.au references: <312014C1.4145@nbnet.nb.ca> organization: Gumleaf Smoke Signals Telegraph Co. newsgroups: comp.os.msdos.misc,comp.sys.ibm.pc.misc,aus.computers.ibm-pc,alt.msdos.batch