(view source code of scsi.kix as plain text)
If $Help
? "SCSI.kix, Version 1.00 for Windows 2000"
? "Enumerate SCSI drives" ?
? "Usage: KIX32.EXE SCSI.KIX [ $$Help=1 ]" ?
? "Written by Rob van der Woude"
? "http://www.robvanderwoude.com" ?
Quit 1
EndIf
Break Off
$Index1 = 0
Do
$PortName = EnumKey( "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\", $Index1 )
If @ERROR = 0
$x = ScsiPort( $PortName )
EndIf
$Index1 = $Index1 + 1
Until @ERROR
?
? "Press any key..."
Get $Key
Function ScsiPort( $Port )
$Index2 = 0
Do
$BusName = EnumKey( "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\$Port\", $Index2 )
If @ERROR = 0
$BusType = ReadValue( "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\$Port", "Driver" )
If $BusType = atapi
$BusType = "IDE"
Else
$BusType = "SCSI"
EndIf
$x = ScsiBus( $Port, $BusName, $BusType )
EndIf
$Index2 = $Index2 + 1
Until @ERROR
EndFunction
Function ScsiBus( $Port, $Bus, $BusType )
$Index3 = 0
Do
$TIdName = EnumKey( "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\$Port\$Bus\", $Index3 )
If @ERROR = 0
If InStr( $TIdName, "Target Id" )
$x = ScsiTId( $Port, $Bus, $TIdName, $BusType )
EndIf
EndIf
$Index3 = $Index3 + 1
Until @ERROR
EndFunction
Function ScsiTId( $Port, $Bus, $TId, $BusType )
$Index4 = 0
Do
$LIdName = EnumKey( "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\$Port\$Bus\$TId\", $Index4 )
If @ERROR = 0
If InStr( $LIdName, "Logical Unit Id" )
$x = ScsiLId( $Port, $Bus, $TId, $LIdName, $BusType )
EndIf
EndIf
$Index4 = $Index4 + 1
Until @ERROR
EndFunction
Function ScsiLId( $Port, $Bus, $TId, $LId, $BusType )
$Identifier = ReadValue( "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\$Port\$Bus\$TId\$LId", "Identifier" )
$DevType = ReadValue( "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\$Port\$Bus\$TId\$LId", "Type" )
If $DevType = "CdRomPeripheral"
$DeviceName = ReadValue( "HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\Scsi\$Port\$Bus\$TId\$LId", "DeviceName" )
Else
$DeviceName = $DevType
EndIf
$Id = SubStr( $Tid, 11 )
? "$Port, $Bus, ID $Id, $BusType, $DeviceName = $Identifier"
EndFunction
page last modified: 2024-04-16; loaded in 0.0058 seconds