The hwdetect (hardware detect) utility performs basic hardware detection functions that are typically obtained by using SMBIOS and a PCI scan.
Thhwdetect utility has options that can be used to dump all of the hardware information to an output file, or it can be used to query hardware information and return values that set the errorlevel environment variable or the return code in Windows PE.
hwdetect performs basic hardware scan functions and more complex PCI device detection options. The basic hardware scan functions can only be used singularly. The PCI device detection functions may be used in combination with each other to produce a query based on multiple restrictions.
You can only use the hwdetect utility basic hardware scan functions one at a time. The PCI-device detection functions can be combined or used more than once on the same command line.
hwdetect [/s|/p|/i|/m:type] [/vid:vendor_id] [/did:device_id] [/svid:sub_vendor_id] [/sdid:sub_device_id] [bn:bus_number] [/dn:device_number] [/add:num]
Parameter | Description |
---|---|
Basic hardware scan functions | |
/s |
Determines if the target server is a LenovoeServer or LenovoeServerxSeries server. The return values are:
|
/p |
|
/i |
|
/m:type |
Compares the machine type of the target xSeries server
to the specified machine type, type. The return values are:
|
Parameter | Description |
---|---|
PCI-device detection functions | |
/vid:vendor_id |
|
/did:device_id |
|
/svid:sub_vendor_id |
|
/sdid:sub_device_id |
|
/bn:bus_number |
|
/dn:device_number |
|
/add:num |
|
Example | Description |
---|---|
hwdetect /s if errorlevel 1 goto NONLenovo if errorlevel 0 goto Lenovo :NONLenovo rem Perform non-Lenovo equipment specific steps here goto FINISH :Lenovo rem Perform Lenovo equipment specific steps here :FINISH |
Determines if the target server is a Lenovo server or not, and branches accordingly to perform equipment-specific steps |
hwdetect /m:8676 if errorlevel 1 goto 8676 hwdetect /m:8669 if errorlevel 1 goto 8669 echo System not supported! goto done :8676 call 8676.bat goto done :8669 call 8669.bat goto done :done |
Determines if the target server is either a machine type 8676 or machine type 8669 server, and branches accordingly to call a system-specific batch file or displays a message of not supporting other machine types |
hwdetect /i>hwdetect.out clini hwdetect.out /S:CI /I:Vendor_ID.0 /E:Vendor CLIniSet.bat |
Creates an output file that lists the hardware configuration for the target server, so that the clini utility can search for a specific PCI adapter from a vendor and set en environment variable accordingly |
hwdetect /vid:0x9005 /did:0x0250 if errorlevel 1 call 6Mstuff.bat |
Determines if there is at least one IBM ServeRAID 6i/6i+/6M PCI adapter in the target server, and calls a batch file to process adapter-specific tasks |
hwdetect /vid:0x9005 /did:0x0250 if errorlevel 0 set TOTAL=0 if errorlevel 1 set TOTAL=1 if errorlevel 2 set TOTAL=2 if errorlevel 3 set TOTAL=3 hwdetect /add:%TOTAL% /vid:0x1014 /did:0x01BD if errorlevel 0 set TOTAL=0 if errorlevel 1 set TOTAL=1 if errorlevel 2 set TOTAL=2 if errorlevel 3 set TOTAL=3 if errorlevel 4 set TOTAL=4 if errorlevel 5 set TOTAL=5 if errorlevel 6 set TOTAL=6 echo There are %TOTAL% Lenovo ServeRAID adapters in this system |
Determines the total number of Lenovo ServeRAID adapters in the target server, assuming there are no more than three of each type: Lenovo ServeRAID 4, Lenovo ServeRAID 5, and Lenovo ServeRAID 6/6i/6M |
hwdetect /i>hwdetect.out |
|
[System] Machine_Type=8674 Model_Number=42X Serial_Number=78Z9506 Product_Name=eserver xSeries 330 BIOS_version=1.04 BIOS_Build_Level=EME112A BIOS_DATE=06/28/2002 BIOS_Manufacturer=Lenovo BIOS_Language=US Number_Of_Enclosures=1 Enclosure_Type.0=23 Processor_Slots=2 Active_Processors=1 Processor_Family.0=17 Processor_Speed_MHz.0=1400 Processor_X64 = TRUE Total_Enabled_Memory_Mb=256 ROM_Diagnostics_Build_Level=EME112A ISMP_Build_Level=BR8T30A RSA_Build_Level=GEE834A System_UUID = 8030E01060F010B010605090D0A020F0 Blade_Chassis_UUID = 0F020A0D0900F00F020A0D0900F00F02 Blade_Slot = 02 [PCI] Total_Number_Devices=10 Bus_Number.0=0 Device_Number.0=1 Function_Number.0=0 Class_Code.0=0000 Revision.0=0 Header_Type.0=0 Vendor_ID.0=5333 Device_ID.0=8A22 Subvendor_ID.0=1014 Subdevice_ID.0=01C5 Bus_Number.1=0 Device_Number.1=2 Function_Number.1=0 Class_Code.1=0000 Revision.1=0 Header_Type.1=0 Vendor_ID.1=8086 Device_ID.1=1229 Subvendor_ID.1=1014 Subdevice_ID.1=105C
System_Machine_Type = 8674 System_Model_Number = 42X System_Serial_Number = 78Z9506 PCI_Bus_Number.0 = 0 PCI_Device_Number.0 = 1 ...