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

Jerold Schulman

March 6, 2002

1 Min Read
ITPro Today logo in a gray background | ITPro Today

I am not happy with the default drive labels that Windows 2000 assigns to the removableCD-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.

Example:

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

DrvLabel D "DO NOT USE"

DrvLabel.bat contains:

@echo off
setlocal
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_USERSoftwareMicrosoftWindowsCurrentVersionExplorerMountPoints%drive%DefaultLabel]>>%TEMP%%drive%.reg
@echo @="%drvlabel%">>%TEMP%%drive%.reg
regedit /s %TEMP%%drive%.reg
del /q %TEMP%%drive%.reg
endlocal
goto :EOF
:syntax
@echo Syntax: DrvLabel DriveLetter "Label Text"
endlocal



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like