Jump to content

Sysprep - Tried Everything - HELP!


Recommended Posts

Now I need to be able to figure out if hyperthreading is enabled, and I can use 1 image for all PCs...

This should be possible with ta.exe that's included as a dos command tool with windows xp embedded.

When you run it, it will create a report file (devices.pmq) with the HAL-type that SHOULD actually be installed (which is not necessarily the one that IS installed) :)

Here's a code snippet that should be run (instead of setup.exe) at first boot of the deployed pc. As you may understand that reg setting was saved (sysprep.reg) and changed just after "sysprep -mini -quiet -reseal -noreboot" and before you shut the master-pc down.

--------------sethal.cmd-------------------
ta.exe

find "ACPIPIC_UP" devices.pmq && SET ACPI=ACPIPIC_UP
find "ACPIAPIC_UP" devices.pmq && SET ACPI=ACPIAPIC_UP
find "ACPIAPIC_MP" devices.pmq && SET ACPI=ACPIAPIC_MP
find "MPS_UP" devices.pmq && SET ACPI=MPS_UP
find "MPS_MP" devices.pmq && SET ACPI=MPS_MP
find "E_ISA_UP" devices.pmq && SET ACPI=E_ISA_UP
find "SYSPRO_MP" devices.pmq && SET ACPI=SYSPRO_MP_UP

rundll32.exe setupapi,InstallHinfSection %ACPI%_HAL 131 %windir%\inf\hal.inf

reg delete HKLM\SYSTEM\ControlSet001\Enum\Root\ACPI_HAL\0000 /f
reg delete HKLM\SYSTEM\ControlSet001\Enum\Root\PCI_HAL\0000 /f

reg import c:\sysprep\sysprep.reg
exit
---------------sethal.cmd----------------------------

O, I forgot; Your HAL should be set to "Standard HAL" on the master-pc beforehand.

-This should pretty much work on ANY pc/laptop that can run XP

-Remember: This is NOT supported by M$.

Edited by Scrapple
Link to comment
Share on other sites


Now I need to be able to figure out if hyperthreading is enabled, and I can use 1 image for all PCs...

This should be possible with ta.exe that's included as a dos command tool with windows xp embedded.

When you run it, it will create a report file (devices.pmq) with the HAL-type that SHOULD actually be installed (which is not necessarily the one that IS installed) :)

Here's a code snippet that should be run (instead of setup.exe) at first boot of the deployed pc. As you may understand that reg setting was saved (sysprep.reg) and changed just after "sysprep -mini -quiet -reseal -noreboot" and before you shut the master-pc down.

O, I forgot; Your HAL should be set to "Standard HAL" on the master-pc beforehand.

-This should pretty much work on ANY pc/laptop that can run XP

-Remember: This is NOT supported by M$.

I'm not sure I follow what you're doing there. Can you explain further?

edit: Let me elaborate. What is in the sysprep.reg file? And where to I get ta.exe?

Edited by fly
Link to comment
Share on other sites

I'm not sure I follow what you're doing there.  Can you explain further?

edit: Let me elaborate.  What is in the sysprep.reg file?  And where to I get ta.exe?

Hi, here's some additional code...

Hope this explains it better. :-)

--------runprep.cmd-------
rem Run sysprep, but no reboot!!!
start /wait c:\sysprep\sysprep.exe -mini -reseal -quiet -noreboot

rem Save sysprep's boot-setup reg-entry (for later import from sethal.cmd)...
reg export HKLM\system\setup c:\sysprep\sysprep.reg

rem ...and change it, so my detection and hal-swap runs first.
REG ADD HKLM\SYSTEM\Setup /v CmdLine /t REG_MULTI_SZ /d "%SystemDrive%\sysprep\sethal.cmd" /f

rem Shutdown and ghost the partition/disk.
shutdown
------------------------------

BTW, ta.exe comes with "Windows xp-embedded"=XPE.

Link to comment
Share on other sites

Very interesting.

Here is what I ended up doing...

This script is called by GUIRunOnce

Option Explicit

' Set variables
Dim oShell, oFSO
Dim sOutputFile, aBiosString, iBiosRecords, sCurBiosString, sAPIC
Dim sUniArray, sMultiArray, sModel

' Setup arrays
' sUniArray is for Dell models with a Uniprocessor
' sMultiArray is for Dell models with a Multiprocessor (Hyperthreading included)
sUniArray = array("GX260")
sMultiArray = array("GX270", "GX280")

'**Start Encode**
' The line above exists if there is a desire to encode the script for security reasons.
' To encode the script, download the script encoder via the link below.
' http://www.msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp

Set oShell = WScript.CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")

' Set our APIC value to initially be false
sAPIC = False

' Run SMBios to find settings
sOutputFile = oShell.ExpandEnvironmentStrings("%TEMP%") & "\Bios.TXT"
oShell.Run "CMD.Exe /C c:\tcs\sysprep\SMBiosD.Exe > " & sOutputFile,0,True

' Read temp file into an Array
aBiosString = Split(UCase(oFSO.OpenTextFile(sOutputFile,1,False).ReadAll),vbCrlf)
iBiosRecords = CStr(UBound(aBiosString)+1)

' Delete temp file
oFSO.DeleteFile sOutputFile

' Find the exception we're looking for (Uniprocessor)
For Each sModel in sUniArray
For Each sCurBiosString in aBiosString
If Instr(1,Ucase(sCurBiosString),sModel,vbBinaryCompare) <> 0 Then
  sAPIC = "Uni"
  Exit For
End If
Next
Next

' Find the exception we're looking for (Multiprocessor)
For Each sModel in sMultiArray
For Each sCurBiosString in aBiosString
If Instr(1,Ucase(sCurBiosString),sModel,vbBinaryCompare) <> 0 Then
  sAPIC = "Multi"
  Exit For
End If
Next
Next

' Do stuff with results
If sAPIC = "Uni" Then
 oShell.Run "C:\tcs\sysprep\DevCon sethwid @ROOT\ACPI_HAL\0000 := +acpiapic_up !acpiapic_mp",1, True
 oShell.Run "C:\tcs\sysprep\DevCon update c:\windows\inf\hal.inf acpiapic_up",1, True
ElseIf sAPIC = "Multi" Then
 oShell.Run "C:\tcs\sysprep\DevCon sethwid @ROOT\ACPI_HAL\0000 := +acpiapic_mp !acpiapic_up",1, True
 oShell.Run "C:\tcs\sysprep\DevCon update c:\windows\inf\hal.inf acpiapic_mp",1, True
End If

wscript.quit

I barely know how to script anything, so the code probably looks horrible. But thanks to this thread, I now have only ONE image to maintain for all my PCs.

:w00t:

Link to comment
Share on other sites

  • 1 year later...

If anyone else is interested, I have updated this script.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' File: HAL.vbs
' Created: 08/11/05
' Updated: 03/05/07
' Version: 1.1
' Author: Zac Holmes
'
' Purpose: This script is designed to run at the end of the Sysprep process.
' It updates the HAL from a standard ACPI HALL to either a
' Uniprocessor or Multiprocessor HAL, based on number of processors.
'
' Prereqs: This script requires the following executables:
' devcon.exe (See http://support.microsoft.com/kb/311272)
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'**Start Encode**
' The line above exists if there is a desire to encode the script for security reasons.
' To encode the script, download the script encoder via the link below.
' http://www.msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp
Option Explicit

' Declare the vars!
Dim objShell, objFSO, strProcs

' I Object to this!
Set objShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

' Get number of processors
strProcs = objShell.ExpandEnvironmentStrings("%NUMBER_OF_PROCESSORS%")

' Do stuff with results
If strProcs = "1" Then 'For ACPI Uniprocessor
objShell.Run "DevCon.exe sethwid @ROOT\ACPI_HAL000 := +acpiapic_up !acpiapic_mp", 0, True
objShell.Run "DevCon.exe update c:\windows\inf\hal.inf acpiapic_up", 0, True
Else 'For ACPI Multiprocessor
objShell.Run "DevCon.exe sethwid @ROOT\ACPI_HAL000 := +acpiapic_mp !acpiapic_up", 0, True
objShell.Run "DevCon.exe update c:\windows\inf\hal.inf acpiapic_mp", 0, True
'Else 'for standard ACPI HAL
' objShell.Run "C:\tcs\sysprep\DevCon sethwid @ROOT\ACPI_HAL000 := +acpipic_up !acpiapic_mp",0, True
' objShell.Run "C:\tcs\sysprep\DevCon update c:\windows\inf\hal.inf acpipic_up",0, True
End If

' Clean up and die
Set objShell = Nothing
Set objFSO = Nothing
Wscript.Quit

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...