Network Administrator Knowledgebase

Oct 28 2008   6:47PM GMT

Detect HALs under WinPE (Vista) by running Batch Script

Michael Khanin Michael Khanin Profile: Michael Khanin

It’s a lot of posts that explained how to detect HAL. Almost all of those solutions done in VB script. As well I’ve seen a lot of post about “problems’ running VB script under WinPE. So, one day I tried to create a batch file, that allows to detect a HAL under WinPE. I did all my tests under VistaPE 12 (I’ve used the VistaPE v.12 RC1).

Here is content of HAL_Detector.bat script:

 

@echo off
REM .
REM . – Advanced Configuration and Power Interface (ACPI) PC:  ACPIPIC_UP
REM . – ACPI Uniprocessor PC:                                                 ACPIAPIC_UP
REM . – ACPI Multiprocessor PC:                                               ACPIAPIC_MP
REM .
REM . Advanced Configuration and Power Interface (ACPI) PC
REM . – halacpi.dll (renamed to hal.dll)
REM . – ntkrnlpa.exe
REM . – ntoskrnl.exe
REM .
REM . ACPI Uniprocessor PC
REM . – halaacpi.dll (renamed to hal.dll)
REM . – ntkrnlpa.exe
REM . – ntoskrnl.exe
REM .
REM . ACPI Multiprocessor PC
REM . – halmacpi.dll (renamed to hal.dll)
REM . – ntkrpamp.exe (renamed to ntkrnlpa.exe)
REM . – ntkrnlmp.exe (renamed to ntoskrnl.exe)
REM .
REM ……………….. Explanation About Diferent HAL Versions ………………… ……..
REM .

SETLOCAL
SET PC-HAL=
SET NumberOfLogicalProcessors=
SET New-HAL=

For /F “Tokens=3 Delims= ” %%a in (‘REG QUERY HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL000 /v HardwareID’) DO Set PC-HAL=%%a

IF %PC-HAL% == acpipic Set New-HAL=ACPI_Uniprocessor_PC
IF %PC-HAL% == acpiapic (
For /F %%a in (‘@WMIC COMPUTERSYSTEM GET NumberOfLogicalProcessors /value^|find “NumberOfLogicalProcessors”‘) do Set %%a
)

IF %NumberOfLogicalProcessors% ==  Set New-HAL=HAL_NOT_DETECTED
IF %NumberOfLogicalProcessors% == 1 Set New-HAL=ACPI_Uniprocessor_PC
IF %NumberOfLogicalProcessors% == 2 Set New-HAL=ACPI_Multiprocessor_PC
IF %NumberOfLogicalProcessors% == 4 Set New-HAL=ACPI_Multiprocessor_PC

@echo Detected HAL: %New-HAL%
@echo Number of Logical Processors: %NumberOfLogicalProcessors%

endlocal

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: