Vbscript / Operating System / Enumerate Cd Drives
List the CD or DVD drives attached to a computer in order to find the drive letter.
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\" & strComputer & "\root\cimv2")
Set colDisks = objWMIService.ExecQuery _ ("Select * from Win32_LogicalDisk")
For each objDisk in colDisks If objDisk.DriveType = 5 Then Wscript.Echo "DeviceID: " & vbTab & objDisk.DeviceID End If
Next
Please note that a disclaimer applies to any code on this page.
|