Entry
Batch: Disk: Name: How to check the name of a disk using 4dos/4nt? [volume / label / @label]
Sep 22nd, 2004 10:49
Knud van Eeden,
----------------------------------------------------------------------
--- Knud van Eeden --- 21 September 2004 - 02:57 am ------------------
Batch: Disk: Name: How to check the name of a disk using 4dos/4nt?
[volume / label / @label]
Especially when you are using USB disks, you will see that the drive
letter might change.
But you want to run a batch file specific for that drive.
What you can do is to give that drive a name,
and then search for that name.
When found you do your action (e.g. running that batch file
for that drive).
---
---
Steps: Overview:
1. -Set the name of your drive once
for example:
e:
label diskbackupknud
2. -Go to all current disk drive names
to see if it is your backup disk
1. If found, then run that batch file
---
---
Steps: Worked out:
1. -Set the name of your drive once
e.g.
e:
label diskbackupknud
2. -Go to all current disk drive names
to see if it is your backup disk
1. If found, then run that batch file
3. Save this as a batch file (e.g. updachec.bat)
This is basically a case statement, searching for your
(e.g. backup) disk name.
if the volume name of disk c: equals that of your backupdisk
or
if the volume name of disk d: equals that of your backupdisk
and so on.
if found do something (in this case running the backup batch
file)
--- cut here: begin --------------------------------------------------
cdd c:\bbc\taal
if %@LABEL[ d: ] == diskbackupknud updadisd.bat
if %@LABEL[ e: ] == diskbackupknud updadise.bat
if %@LABEL[ f: ] == diskbackupknud updadisf.bat
if %@LABEL[ g: ] == diskbackupknud updadisg.bat
if %@LABEL[ h: ] == diskbackupknud updadish.bat
if %@LABEL[ i: ] == diskbackupknud updadisi.bat
if %@LABEL[ j: ] == diskbackupknud updadisj.bat
if %@LABEL[ k: ] == diskbackupknud updadisk.bat
if %@LABEL[ l: ] == diskbackupknud updadisl.bat
if %@LABEL[ m: ] == diskbackupknud updadism.bat
if %@LABEL[ n: ] == diskbackupknud updadisn.bat
if %@LABEL[ o: ] == diskbackupknud updadiso.bat
if %@LABEL[ p: ] == diskbackupknud updadisp.bat
if %@LABEL[ q: ] == diskbackupknud updadisq.bat
--- cut here: end ----------------------------------------------------
---
---
Tested successfully on Microsoft Windows XP Professional with
4NT v5.00U
---
---
Internet: see also:
---
Batch: Disk: Name: Operation: Get: How to get the name of a disk using
4dos/4nt? [@label / volume]
http://www.faqts.com/knowledge_base/view.phtml/aid/31505/fid/936
---
Batch: Disk: Name: Operation: Set: How to set the name of a disk using
4dos/4nt? [@label / volume]
http://www.faqts.com/knowledge_base/view.phtml/aid/31502/fid/936
----------------------------------------------------------------------