Jump to content

Detect HALs under WinPE (Vista) by running Batch Script


Pelekan

Recommended Posts

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 test 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_HAL\0000 /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

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...