Script to Detect What's in a Laptop Modular Bay
Keywords: baywatch laptop modular bay
Finds whether CD-ROM, ZIP, or LS-120 drive is in modular bay on laptop.
Removable drives are listed as SCSI devices in the Registry.
Doesn't help with FDD, which is ALWAYS listed, and is not listed as a SCSI device.
; Baywatch.wbt
; (Sorry, Pamela)
EnumStr = "Config Manager\Enum"
SCSIKey = ""
isSCSI = @false
bayKey = RegOpenkey(@RegClasses + 6,enumStr) ;Accesses HKEY_DYN_DATA\Config Manager\Enum
keyList = RegQueryKeys(bayKey) ;Gets a list of all the subkeys
For keyCount = 1 to 85 ;Looks for SCSI in the HardwareKey subkeys- subkey not always named the same
errormode(@off)
keyQuery=RegQueryKey(baykey,keyCount)
errormode(@on)
If keyQuery == "" Then Break
wholeKey = StrCat(enumStr,"\",keyQuery,"[HardwareKey]")
keyStr = RegQueryValue(@RegClasses+6,wholeKey)
If StrSub(keyStr,1,4) == "SCSI"
isSCSI = @true
SCSIKey = StrCat("HKEY_DYN_DATA\",EnumStr,"\",keyQuery,@crlf,@crlf,"(subkey number %keyCount%)",@crlf,@crlf,StrSub(keyStr,1,20))
Break
EndIf
Next
RegCloseKey(bayKey)
If isSCSI ==@false ;Reports what hardware was found
Message("Hardware Information","No drive is in the modular bay.")
Return
Else
Message("Hardware Information",SCSIKey)
EndIf
AddExtender("wilx34I.dll")
ready = xDriveReady("d:")
bayLabel = "(No Label)"
If ready Then bayLabel = xDiskLabelGet("d:")
bayInfo = StrCat("The drivebay contains ",StrSub(keyStr,6,15),@crlf,@crlf,"The disk label is: ",bayLabel)
Message("Media Information",bayInfo) ;Reports what media were found
Return
Article ID: W14490
Filename: Detect Whats in Laptop Modular Bay.txt