Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CD-Rom Drive Letter

Status
Not open for further replies.

TechSuppSwany

Technical User
Jul 26, 2004
5
GB
Hi

I Need to change the CD-Rom Drive letter via a script or batch file.

I have found that I'm able to change a hard Drive Volume's Letter, for example "Drive D" to Drive "Q", using the below vbs script. The reason for changing the drive letters in this way, is connected to an on going project, and as part of a scripted Server build problem I've logged on this site and many other already.

Example WHS VBS script !

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colVolumes = objWMIService.ExecQuery("Select * from Win32_Volume Where Name = 'D:\\'")
For Each objVolume in colVolumes
objVolume.DriveLetter = "Q:"
objVolume.Put_
Next

My question is, if anyone knows how to make the same kind of script above work against CD Rom drive, rather than an actual hard disk drive

Regards
Swany
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top