TechSuppSwany
Technical User
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
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