JSI Tip 4930. How do I change the default drive label of my Windows 2000 CD drives?

I am not happy with the default drive labels that Windows 2000 assigns to the removable CD-ROM type drives.

I scripted DrvLabel.bat, to change them on my client computers, using Workstation.bat.

The syntax for using DrvLabel.bat is:

DrvLabel DriveLetter "Label Text"

where DriveLetter is the drive letter of the CD type drive, without the colon (:), and "Label Text" is the text you want displayed in My Computer.


To set the D drive label to DO NOT USE, type:

DrvLabel D "DO NOT USE"

DrvLabel.bat contains:

@echo off
If \{%2\}==\{\} goto syntax
set drive=%1
set drvlabel=%2
set drvlabel=%drvlabel:"=%
set work=%drive%#
if "%work:~1,1%" NEQ "#" goto syntax
@echo REGEDIT4>%TEMP%\%drive%.reg
@echo \[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\%drive%\DefaultLabel\]>>%TEMP%\%drive%.reg
@echo @="%drvlabel%">>%TEMP%\%drive%.reg
regedit /s %TEMP%\%drive%.reg
del /q %TEMP%\%drive%.reg
goto :EOF
@echo Syntax: DrvLabel DriveLetter "Label Text"

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.